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

Unified Diff: third_party/WebKit/Source/modules/fetch/FetchManager.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/Response.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d9f61e91161332fc11c30ab1e5b31a3bca1c1651..33a27788c39189eb9e78a0eb58ea79fe2dc13a4c 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -30,6 +30,7 @@
#include "modules/fetch/Response.h"
#include "modules/fetch/ResponseInit.h"
#include "platform/HTTPNames.h"
+#include "platform/network/NetworkUtils.h"
#include "platform/network/ResourceError.h"
#include "platform/network/ResourceRequest.h"
#include "platform/network/ResourceResponse.h"
@@ -46,11 +47,6 @@ namespace blink {
namespace {
-bool IsRedirectStatusCode(int statusCode) {
- return (statusCode == 301 || statusCode == 302 || statusCode == 303 ||
- statusCode == 307 || statusCode == 308);
-}
-
class SRIBytesConsumer final : public BytesConsumer {
public:
// BytesConsumer implementation
@@ -433,7 +429,7 @@ void FetchManager::Loader::didReceiveResponse(
FetchResponseData* taintedResponse = nullptr;
- if (IsRedirectStatusCode(m_responseHttpStatusCode)) {
+ if (NetworkUtils::isRedirectResponseCode(m_responseHttpStatusCode)) {
Vector<String> locations;
responseData->headerList()->getAll(HTTPNames::Location, locations);
if (locations.size() > 1) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/Response.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698