[Qt] Redirection of HTTP POST (3xx) incorrectly includes original POST data
authorluiz@webkit.org <luiz@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 May 2011 19:00:37 +0000 (19:00 +0000)
committerluiz@webkit.org <luiz@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 May 2011 19:00:37 +0000 (19:00 +0000)
commit197109deb9c618250c1124c71bc7e2f25366b2e7
tree1a1335ea3006f6ebda67fa01af42b8ae9ec837df
parent6160ecb75adc8d641e4e4e1a89da975e7c6ec482
[Qt] Redirection of HTTP POST (3xx) incorrectly includes original POST data
https://bugs.webkit.org/show_bug.cgi?id=60440

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Makes sure that the HTTP headers Content-type and Content-length are not included in
the requests that do not have any content.

Tests: http/tests/navigation/post-301-response.html
       http/tests/navigation/post-302-response.html
       http/tests/navigation/post-303-response.html
       http/tests/navigation/post-307-response.html

* platform/network/qt/QNetworkReplyHandler.cpp:
(WebCore::QNetworkReplyHandler::sendNetworkRequest):

LayoutTests:

These new tests check that no POST content is sent to the new URL after receiving http
status codes 301, 302 and 303, and checks that the POST content is sent to the new URL
after receiving a 307 http status code.

* http/tests/navigation/post-301-response-expected.txt: Added.
* http/tests/navigation/post-301-response.html: Added.
* http/tests/navigation/post-302-response-expected.txt: Added.
* http/tests/navigation/post-302-response.html: Added.
* http/tests/navigation/post-303-response-expected.txt: Added.
* http/tests/navigation/post-303-response.html: Added.
* http/tests/navigation/post-307-response-expected.txt: Added.
* http/tests/navigation/post-307-response.html: Added.
* http/tests/navigation/resources/redirected-post-request-contents.php: Added.
* http/tests/navigation/resources/redirection-response.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/navigation/post-301-response-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-301-response.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-302-response-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-302-response.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-303-response-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-303-response.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-307-response-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-307-response.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.php [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/redirection-response.php [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp