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

Unified Diff: content/child/npapi/plugin_url_fetcher.cc

Issue 345833002: Handle redirects with NULL headers in PluginURLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/npapi/plugin_url_fetcher.cc
diff --git a/content/child/npapi/plugin_url_fetcher.cc b/content/child/npapi/plugin_url_fetcher.cc
index acd508ba922ebbf2b7c7e267cb2057a75dd893a5..421c394b3bbc1b49024d87199e00369a97307da4 100644
--- a/content/child/npapi/plugin_url_fetcher.cc
+++ b/content/child/npapi/plugin_url_fetcher.cc
@@ -213,7 +213,17 @@ bool PluginURLFetcher::OnReceivedRedirect(
// It's unfortunate that this logic of when a redirect's method changes is
// in url_request.cc, but weburlloader_impl.cc and this file have to duplicate
// it instead of passing that information.
- int response_code = info.headers->response_code();
+ int response_code;
+ if (info.headers) {
+ response_code = info.headers->response_code();
+ } else {
+ // A redirect may have NULL headers if it came from URLRequestRedirectJob.
+ //
+ // TODO(davidben): Get the actual response code from the browser. Either
+ // fake enough of headers to have a response code or pass it down as part of
+ // https://crbug.com/384609.
+ response_code = 307;
+ }
method_ = net::URLRequest::ComputeMethodForRedirect(method_, response_code);
GURL old_url = url_;
url_ = new_url;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698