| Index: net/url_request/url_request_http_job.cc
|
| diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
| index 41b15158d5728f0022466d97b8991e4b4de8b755..04bdcfda8af9ebaa7d41de6171d3908c46aa5327 100644
|
| --- a/net/url_request/url_request_http_job.cc
|
| +++ b/net/url_request/url_request_http_job.cc
|
| @@ -1034,6 +1034,17 @@ Filter* URLRequestHttpJob::SetupFilter() const {
|
| ? Filter::Factory(encoding_types, *filter_context_) : NULL;
|
| }
|
|
|
| +bool URLRequestHttpJob::IsRedirectFragmentModificationAllowed(
|
| + const GURL& location) const {
|
| + // Allow modification of reference fragments by default, unless
|
| + // |allowed_unsafe_redirect_url_| is set and equal to the redirect URL.
|
| + // When this is the case, we assume that the network delegate has set the
|
| + // desired redirect URL (with or without fragment), so it must not be changed
|
| + // any more.
|
| + return !allowed_unsafe_redirect_url_.is_valid() ||
|
| + allowed_unsafe_redirect_url_ != location;
|
| +}
|
| +
|
| bool URLRequestHttpJob::IsSafeRedirect(const GURL& location) {
|
| // HTTP is always safe.
|
| // TODO(pauljensen): Remove once crbug.com/146591 is fixed.
|
| @@ -1041,14 +1052,10 @@ bool URLRequestHttpJob::IsSafeRedirect(const GURL& location) {
|
| (location.scheme() == "http" || location.scheme() == "https")) {
|
| return true;
|
| }
|
| - // Delegates may mark an URL as safe for redirection.
|
| - if (allowed_unsafe_redirect_url_.is_valid()) {
|
| - GURL::Replacements replacements;
|
| - replacements.ClearRef();
|
| - if (allowed_unsafe_redirect_url_.ReplaceComponents(replacements) ==
|
| - location.ReplaceComponents(replacements)) {
|
| - return true;
|
| - }
|
| + // Delegates may mark a URL as safe for redirection.
|
| + if (allowed_unsafe_redirect_url_.is_valid() &&
|
| + allowed_unsafe_redirect_url_ == location) {
|
| + return true;
|
| }
|
| // Query URLRequestJobFactory as to whether |location| would be safe to
|
| // redirect to.
|
|
|