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

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

Issue 2526343003: Introduce new security restrictions in FetchEvent.respondWith(). (Closed)
Patch Set: incorporated falken's comment Created 4 years 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
Index: third_party/WebKit/Source/modules/fetch/FetchManager.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
index 87f92a5346515160846c6a209ee17268907cb7cd..471c0a995fe0823e68268d3f02adae48e8a5a5dd 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -408,8 +408,8 @@ void FetchManager::Loader::didReceiveResponse(
tainting = FetchRequestData::OpaqueTainting;
break;
case WebServiceWorkerResponseTypeOpaqueRedirect:
- // ServiceWorker can't respond to the request from fetch() with an
- // opaque redirect response.
+ DCHECK(NetworkUtils::isRedirectResponseCode(m_responseHttpStatusCode));
+ break; // The code below creates an opaque-redirect filtered response.
case WebServiceWorkerResponseTypeError:
LOG(FATAL) << "When ServiceWorker respond to the request from fetch() "
"with an error response, FetchManager::Loader::didFail() "

Powered by Google App Engine
This is Rietveld 408576698