Chromium Code Reviews| Index: content/child/web_url_loader_impl.cc |
| diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc |
| index 2ef11d1dada676638d6f0414d88477382efac90f..9197aae3a4ad21156edcfe9a1456c9f311924d1d 100644 |
| --- a/content/child/web_url_loader_impl.cc |
| +++ b/content/child/web_url_loader_impl.cc |
| @@ -640,12 +640,11 @@ bool WebURLLoaderImpl::Context::OnReceivedRedirect( |
| : blink::WebURLRequest::SkipServiceWorker::All, |
| &new_request); |
| - client_->willFollowRedirect(loader_, new_request, response, |
| - info.encoded_data_length); |
| - request_ = new_request; |
| + bool follow = client_->willFollowRedirect(loader_, new_request, response, |
| + info.encoded_data_length); |
| + if (follow) { |
|
jochen (gone - plz use gerrit)
2016/09/30 11:11:24
maybe just early exist if !follow here?
tyoshino (SeeGerritForStatus)
2016/10/04 04:02:25
Yeah. Done
|
| + request_ = new_request; |
| - // Only follow the redirect if WebKit left the URL unmodified. |
| - if (redirect_info.new_url == GURL(new_request.url())) { |
|
jochen (gone - plz use gerrit)
2016/09/30 11:11:24
can we DCHECK() that redirect_info.new_url == new_
tyoshino (SeeGerritForStatus)
2016/10/04 04:02:24
Added
|
| // First-party cookie logic moved from DocumentLoader in Blink to |
| // net::URLRequest in the browser. Assert that Blink didn't try to change it |
| // to something else. |
| @@ -654,9 +653,8 @@ bool WebURLLoaderImpl::Context::OnReceivedRedirect( |
| return true; |
| } |
| - // We assume that WebKit only changes the URL to suppress a redirect, and we |
| - // assume that it does so by setting it to be invalid. |
| - DCHECK(!new_request.url().isValid()); |
| + request_ = WebURLRequest(); |
| + |
| return false; |
| } |