diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 21:16:17 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 21:16:17 +0000 |
commit | 5dc791943076869a388544d8d32eabe3df62c53c (patch) | |
tree | 82453804646baa515784b28d1e81f7f13a040352 /net | |
parent | 1f5d0920228df6addb772ac2ad6a665be4ebd3fe (diff) | |
download | chromium_src-5dc791943076869a388544d8d32eabe3df62c53c.zip chromium_src-5dc791943076869a388544d8d32eabe3df62c53c.tar.gz chromium_src-5dc791943076869a388544d8d32eabe3df62c53c.tar.bz2 |
Fix 307 redirects of a POST request to actually send the body again, and add a
test.
Note: the fix is trivial, but adding support for a test required teaching the
FileHandler of testserver to consume a post body.
BUG=16832
TEST=covered by unit test
R=abarth
Review URL: http://codereview.chromium.org/149710
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/data/url_request_unittest/redirect307-to-echo (renamed from net/data/url_request_unittest/redirect307-to-echoall) | 0 | ||||
-rw-r--r-- | net/data/url_request_unittest/redirect307-to-echo.mock-http-headers | 2 | ||||
-rw-r--r-- | net/data/url_request_unittest/redirect307-to-echoall.mock-http-headers | 2 | ||||
-rw-r--r-- | net/url_request/url_request.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.cc | 3 |
5 files changed, 4 insertions, 5 deletions
diff --git a/net/data/url_request_unittest/redirect307-to-echoall b/net/data/url_request_unittest/redirect307-to-echo index 7898192..7898192 100644 --- a/net/data/url_request_unittest/redirect307-to-echoall +++ b/net/data/url_request_unittest/redirect307-to-echo diff --git a/net/data/url_request_unittest/redirect307-to-echo.mock-http-headers b/net/data/url_request_unittest/redirect307-to-echo.mock-http-headers new file mode 100644 index 0000000..3d9f6a9 --- /dev/null +++ b/net/data/url_request_unittest/redirect307-to-echo.mock-http-headers @@ -0,0 +1,2 @@ +HTTP/1.1 307 Yo +Location: /echo diff --git a/net/data/url_request_unittest/redirect307-to-echoall.mock-http-headers b/net/data/url_request_unittest/redirect307-to-echoall.mock-http-headers deleted file mode 100644 index 33393cc..0000000 --- a/net/data/url_request_unittest/redirect307-to-echoall.mock-http-headers +++ /dev/null @@ -1,2 +0,0 @@ -HTTP/1.1 307 Yo -Location: /echoall/ diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 9f6e229..7dfad41 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -438,9 +438,9 @@ int URLRequest::Redirect(const GURL& location, int http_status_code) { // prompt and so shall we. strip_post_specific_headers = method_ == "POST"; method_ = "GET"; + upload_ = NULL; } url_ = location; - upload_ = NULL; --redirect_limit_; if (strip_post_specific_headers) { diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 7750012..5a5af4a 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -1342,8 +1342,7 @@ TEST_F(URLRequestTest, Post302RedirectGet) { EXPECT_TRUE(ContainsString(data, "Accept-Charset:")); } -// TODO(darin): Re-enable this test once bug 16832 is fixed. -TEST_F(URLRequestTest, DISABLED_Post307RedirectPost) { +TEST_F(URLRequestTest, Post307RedirectPost) { const char kData[] = "hello world"; scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); |