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

Unified Diff: Source/modules/fetch/FetchManager.cpp

Issue 891753002: [Fetch] Disable no-cors in non-serviceworker (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add failure expectations. Created 5 years, 10 months 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/FetchManager.cpp
diff --git a/Source/modules/fetch/FetchManager.cpp b/Source/modules/fetch/FetchManager.cpp
index 602a217f21f10511716d567cbb899fa510112f2a..5c72ea51574515699a59d3977508d7a382fa516f 100644
--- a/Source/modules/fetch/FetchManager.cpp
+++ b/Source/modules/fetch/FetchManager.cpp
@@ -170,6 +170,12 @@ void FetchManager::Loader::didFailRedirectCheck()
void FetchManager::Loader::start()
{
+ if (!executionContext()->isServiceWorkerGlobalScope()
+ && m_request->mode() == WebURLRequest::FetchRequestModeNoCORS) {
+ performNetworkError("no-cors is disabled for non-serviceworker.");
+ return;
+ }
+
// "1. If |request|'s url contains a Known HSTS Host, modify it per the
// requirements of the 'URI [sic] Loading and Port Mapping' chapter of HTTP
// Strict Transport Security."
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698