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

Unified Diff: net/url_request/url_request_job.cc

Issue 212543005: Do not copy reference fragments for overridden redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « net/url_request/url_request_job.h ('k') | net/url_request/url_request_redirect_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_job.cc
diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc
index 35dbbb1d16c6cbac47105b613c8fda3206b44dcf..31a0d508e043eb0642936eeade8d7ad900d7407c 100644
--- a/net/url_request/url_request_job.cc
+++ b/net/url_request/url_request_job.cc
@@ -158,6 +158,10 @@ bool URLRequestJob::IsRedirectResponse(GURL* location,
return true;
}
+bool URLRequestJob::CopyFragmentOnRedirect(const GURL& location) const {
+ return true;
+}
+
bool URLRequestJob::IsSafeRedirect(const GURL& location) {
return true;
}
@@ -335,7 +339,8 @@ void URLRequestJob::NotifyHeadersComplete() {
// Move the reference fragment of the old location to the new one if the
// new one has none. This duplicates mozilla's behavior.
- if (url.is_valid() && url.has_ref() && !new_location.has_ref()) {
+ if (url.is_valid() && url.has_ref() && !new_location.has_ref() &&
+ CopyFragmentOnRedirect(new_location)) {
GURL::Replacements replacements;
// Reference the |ref| directly out of the original URL to avoid a
// malloc.
« no previous file with comments | « net/url_request/url_request_job.h ('k') | net/url_request/url_request_redirect_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698