Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11830)

Unified Diff: content/browser/service_worker/service_worker_request_handler.cc

Issue 716083003: [ServiceWorker] support OPTIONS request for ServiceWorker [2/3 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_request_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6c871e6cd55ba588518b0f856964d472c927fb2a..31e5b6a26cce614d3480c0c441f113d7dd4c5178 100644
--- a/content/browser/service_worker/service_worker_request_handler.cc
+++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -48,13 +48,6 @@ class ServiceWorkerRequestInterceptor
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestInterceptor);
};
-// This is work around to avoid hijacking CORS preflight.
-// TODO(horo): Remove this check when we implement "HTTP fetch" correctly.
-// http://fetch.spec.whatwg.org/#concept-http-fetch
-bool IsMethodSupportedForServiceWorker(const std::string& method) {
- return method != "OPTIONS";
-}
-
} // namespace
void ServiceWorkerRequestHandler::InitializeHandler(
@@ -70,10 +63,8 @@ void ServiceWorkerRequestHandler::InitializeHandler(
RequestContextType request_context_type,
RequestContextFrameType frame_type,
scoped_refptr<ResourceRequestBody> body) {
- if (!request->url().SchemeIsHTTPOrHTTPS() ||
- !IsMethodSupportedForServiceWorker(request->method())) {
+ if (!request->url().SchemeIsHTTPOrHTTPS())
return;
- }
if (!context_wrapper || !context_wrapper->context() ||
provider_id == kInvalidServiceWorkerProviderId) {
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_request_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698