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

Unified Diff: net/http/http_response_headers.h

Issue 154473002: Support redirectUrl at onHeadersReceived in WebRequest / DWR API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more tests Created 6 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
Index: net/http/http_response_headers.h
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index deba3b6d974fd45c42f20d8b7f94b14182d1573f..2707316395eb14c46ed091003f40799c62003534 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -15,6 +15,7 @@
#include "net/base/net_export.h"
#include "net/base/net_log.h"
#include "net/http/http_version.h"
+#include "url/gurl.h"
class Pickle;
class PickleIterator;
@@ -190,6 +191,16 @@ class NET_EXPORT HttpResponseHeaders
// redirect.
static bool IsRedirectResponseCode(int response_code);
+ // Replace the Location header and HTTP status line, then mark the redirect
+ // URL as safe, i.e. assume that the redirect is always allowed.
+ void SetSafeRedirect(GURL new_url);
+
+ // Whether |location| matches a redirect target that has been marked as safe.
+ bool IsSafeRedirect(const GURL& location) const;
+
+ // Whether a safe redirection target has been set.
+ bool HasSafeRedirect() const;
+
// Returns true if the response cannot be reused without validation. The
// result is relative to the current_time parameter, which is a parameter to
// support unit testing. The request_time parameter indicates the time at
@@ -397,6 +408,9 @@ class NET_EXPORT HttpResponseHeaders
// This is the parsed HTTP response code.
int response_code_;
+ // A redirect target that has explicitly been marked as safe.
+ GURL allowed_unsafe_redirect_url_;
+
// The normalized http version (consistent with what GetStatusLine() returns).
HttpVersion http_version_;

Powered by Google App Engine
This is Rietveld 408576698