[Qt] Redirection of HTTP POST (3xx) incorrectly includes original POST data
authorLuiz Agostini <luiz@webkit.org>
Tue, 17 May 2011 19:00:37 +0000 (19:00 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Wed, 18 May 2011 14:10:05 +0000 (11:10 -0300)
commit6eee7bc0b2147d71d48e0e819f21f4f19f83be0b
tree3830d7957dcc5f45bde58533b8bd443e03ecbcc9
parentbcf16f15581dbbf4ae1a6ea0c04f5eb5d9f3dfb5
[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: http://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