| 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..ed26f8ead2b0a3cfa2ff8892cae7c399d376c42d 100644
|
| --- a/content/browser/service_worker/service_worker_request_handler.cc
|
| +++ b/content/browser/service_worker/service_worker_request_handler.cc
|
| @@ -38,6 +38,15 @@ class ServiceWorkerRequestInterceptor
|
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestInterceptor);
|
| };
|
|
|
| +bool IsMethodSupported(const std::string& method) {
|
| + return (method == "GET") || (method == "HEAD");
|
| +}
|
| +
|
| +bool IsSchemeAndMethodSupported(const net::URLRequest* request) {
|
| + return request->url().SchemeIsHTTPOrHTTPS() &&
|
| + IsMethodSupported(request->method());
|
| +}
|
| +
|
| } // namespace
|
|
|
| void ServiceWorkerRequestHandler::InitializeHandler(
|
| @@ -46,8 +55,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) {
|
|
|