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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/FetchRespondWithObserver.cpp

Issue 2755643004: [ServiceWorker] Introduce the new security restriction of redirected response. (Closed)
Patch Set: change comment Created 3 years, 9 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 | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-redirect-iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/serviceworkers/FetchRespondWithObserver.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/FetchRespondWithObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/FetchRespondWithObserver.cpp
index 39cd2ddd8f53c45c38f02064ef3f5b8ccbd0ac3c..46bf173b5eb584c9f76d33900ba450af7d34dc49 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/FetchRespondWithObserver.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/FetchRespondWithObserver.cpp
@@ -99,22 +99,6 @@ const String getMessageForResponseError(WebServiceWorkerResponseError error,
return errorMessage;
}
-const String getErrorMessageForRedirectedResponseForNavigationRequest(
- const KURL& requestURL,
- const Vector<KURL>& responseURLList) {
- String errorMessage =
- "In Chrome 59, the navigation to \"" + requestURL.getString() + "\" " +
- "will result in a network error, because FetchEvent.respondWith() was " +
- "called with a redirected response. See https://crbug.com/658249. The " +
- "url list of the response was: [\"" + responseURLList[0].getString() +
- "\"";
- for (size_t i = 1; i < responseURLList.size(); ++i) {
- errorMessage =
- errorMessage + ", \"" + responseURLList[i].getString() + "\"";
- }
- return errorMessage + "]";
-}
-
bool isNavigationRequest(WebURLRequest::FrameType frameType) {
return frameType != WebURLRequest::FrameTypeNone;
}
@@ -213,18 +197,9 @@ void FetchRespondWithObserver::onResponseFulfilled(const ScriptValue& value) {
}
if (m_redirectMode != WebURLRequest::FetchRedirectModeFollow &&
response->redirected()) {
- if (!isNavigationRequest(m_frameType)) {
- onResponseRejected(
- WebServiceWorkerResponseErrorRedirectedResponseForNotFollowRequest);
- return;
- }
- // TODO(horo): We should just reject even if the request was a navigation.
- // Currently we measure the impact of the restriction with the use counter
- // in DocumentLoader.
- getExecutionContext()->addConsoleMessage(ConsoleMessage::create(
- JSMessageSource, ErrorMessageLevel,
- getErrorMessageForRedirectedResponseForNavigationRequest(
- m_requestURL, response->internalURLList())));
+ onResponseRejected(
+ WebServiceWorkerResponseErrorRedirectedResponseForNotFollowRequest);
+ return;
}
if (response->isBodyLocked()) {
onResponseRejected(WebServiceWorkerResponseErrorBodyLocked);
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-redirect-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698