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

Unified Diff: chrome_frame/urlmon_url_request.cc

Issue 333043: If a HTTP post to a server returns any redirect code other than 307, then bro... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome_frame/test/net/fake_external_tab.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/urlmon_url_request.cc
===================================================================
--- chrome_frame/urlmon_url_request.cc (revision 30151)
+++ chrome_frame/urlmon_url_request.cc (working copy)
@@ -168,6 +168,17 @@
// Fetch the redirect status as they aren't all equal (307 in particular
// retains the HTTP request verb).
redirect_status_ = GetHttpResponseStatus();
+ // NOTE: Even though RFC 2616 says to preserve the request method when
+ // following a 302 redirect, normal browsers don't do that. Instead they
+ // all convert a POST into a GET in response to a 302 and so shall we.
+ // For 307 redirects, browsers preserve the method. The RFC says to
+ // prompt the user to confirm the generation of a new POST request, but
+ // IE omits this prompt and so shall we.
amit 2009/10/27 17:53:57 Does chrome do this as well?
ananta 2009/10/27 18:04:35 yes,
+ if (redirect_status_ != 307 &&
+ LowerCaseEqualsASCII(method(), "post")) {
+ set_method("get");
+ post_data_len_ = 0;
+ }
break;
default:
« no previous file with comments | « chrome_frame/test/net/fake_external_tab.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698