| Index: content/browser/service_worker/service_worker_request_handler.cc
|
| diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
|
| index 4fbd76e78ea4ea37b4121547dcaed7dc927efe1b..a1a05f39c74ac61ace3ba2b839ae8d42f1ebc6d0 100644
|
| --- a/content/browser/service_worker/service_worker_request_handler.cc
|
| +++ b/content/browser/service_worker/service_worker_request_handler.cc
|
| @@ -38,6 +38,20 @@ class ServiceWorkerRequestInterceptor
|
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestInterceptor);
|
| };
|
|
|
| +bool IsSchemeSupported(const GURL& url) {
|
| + // TODO(michaeln): https only
|
| + return url.SchemeIs("http") || url.SchemeIs("https");
|
| +}
|
| +
|
| +bool IsMethodSupported(const std::string& method) {
|
| + return (method == "GET") || (method == "HEAD");
|
| +}
|
| +
|
| +bool IsSchemeAndMethodSupported(const net::URLRequest* request) {
|
| + return IsSchemeSupported(request->url()) &&
|
| + IsMethodSupported(request->method());
|
| +}
|
| +
|
| } // namespace
|
|
|
| void ServiceWorkerRequestHandler::InitializeHandler(
|
| @@ -46,8 +60,10 @@ void ServiceWorkerRequestHandler::InitializeHandler(
|
| int process_id,
|
| int provider_id,
|
| ResourceType::Type resource_type) {
|
| - if (!ServiceWorkerUtils::IsFeatureEnabled())
|
| + if (!ServiceWorkerUtils::IsFeatureEnabled() ||
|
| + !IsSchemeAndMethodSupported(request)) {
|
| return;
|
| + }
|
|
|
| if (!context_wrapper || !context_wrapper->context() ||
|
| provider_id == kInvalidServiceWorkerProviderId) {
|
|
|