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

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

Issue 2433363002: Use net::HttpResponseHeaders::IsRedirectResponseCode() from Blink (Closed)
Patch Set: Created 4 years, 2 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
Index: third_party/WebKit/Source/modules/fetch/Response.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp
index 7a8ad09b960a7d4df3c3138cad3971c452cefd1d..50d5c8629a0651016371a11d15f16387116cf707 100644
--- a/third_party/WebKit/Source/modules/fetch/Response.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -26,6 +26,7 @@
#include "modules/fetch/ResponseInit.h"
#include "platform/network/EncodedFormData.h"
#include "platform/network/HTTPHeaderMap.h"
+#include "platform/network/NetworkUtils.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h"
#include "wtf/RefPtr.h"
#include <memory>
@@ -312,8 +313,7 @@ Response* Response::redirect(ExecutionContext* context,
return nullptr;
}
- if (status != 301 && status != 302 && status != 303 && status != 307 &&
- status != 308) {
+ if (!NetworkUtils::isRedirectResponseCode(status)) {
exceptionState.throwRangeError("Invalid status code");
return nullptr;
}
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/FetchManager.cpp ('k') | third_party/WebKit/Source/platform/network/NetworkUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698