Commit 543a7f86 authored by robert@webkit.org's avatar robert@webkit.org

2010-04-05 Robert Hogan <robert@webkit.org>

        Reviewed by Kenneth Rohde-Christiansen.

        [Qt] Fix infinite redirection loop in QNetworkReplyHandler

        Qt enters an infinite loop if a redirect response redirects to itself.

        Fixes http/tests/xmlhttprequest/connection-error-sync.html

        https://bugs.webkit.org/show_bug.cgi?id=37097

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

2010-04-05  Robert Hogan  <robert@webkit.org>

        Reviewed by Kenneth Rohde-Christiansen.

        [Qt] Fix infinite redirection loop in QNetworkReplyHandler

        Unskip http/tests/xmlhttprequest/connection-error-sync.html

        https://bugs.webkit.org/show_bug.cgi?id=37097

        * platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 03d32669
2010-04-05 Robert Hogan <robert@webkit.org>
Reviewed by Kenneth Rohde-Christiansen.
[Qt] Fix infinite redirection loop in QNetworkReplyHandler
Unskip http/tests/xmlhttprequest/connection-error-sync.html
https://bugs.webkit.org/show_bug.cgi?id=37097
* platform/qt/Skipped:
2010-04-05 Kenneth Rohde Christiansen <kenneth@webkit.org> 2010-04-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
Unreviewed layout test fix. Unreviewed layout test fix.
......
...@@ -5015,7 +5015,6 @@ http/tests/xmlhttprequest/access-control-preflight-sync-header-denied.html ...@@ -5015,7 +5015,6 @@ http/tests/xmlhttprequest/access-control-preflight-sync-header-denied.html
http/tests/xmlhttprequest/access-control-preflight-sync-method-denied.html http/tests/xmlhttprequest/access-control-preflight-sync-method-denied.html
http/tests/xmlhttprequest/access-control-response-with-body-sync.html http/tests/xmlhttprequest/access-control-response-with-body-sync.html
http/tests/xmlhttprequest/cache-override.html http/tests/xmlhttprequest/cache-override.html
http/tests/xmlhttprequest/connection-error-sync.html
http/tests/xmlhttprequest/cookies.html http/tests/xmlhttprequest/cookies.html
http/tests/xmlhttprequest/methods-lower-case.html http/tests/xmlhttprequest/methods-lower-case.html
http/tests/xmlhttprequest/methods.html http/tests/xmlhttprequest/methods.html
......
2010-04-05 Robert Hogan <robert@webkit.org>
Reviewed by Kenneth Rohde-Christiansen.
[Qt] Fix infinite redirection loop in QNetworkReplyHandler
Qt enters an infinite loop if a redirect response redirects to itself.
Fixes http/tests/xmlhttprequest/connection-error-sync.html
https://bugs.webkit.org/show_bug.cgi?id=37097
* platform/network/qt/QNetworkReplyHandler.cpp:
(WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
2010-04-05 Yury Semikhatsky <yurys@chromium.org> 2010-04-05 Yury Semikhatsky <yurys@chromium.org>
Unreviewed, revert r57078. Unreviewed, revert r57078.
...@@ -335,9 +335,17 @@ void QNetworkReplyHandler::sendResponseIfNeeded() ...@@ -335,9 +335,17 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
QUrl redirection = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); QUrl redirection = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
if (redirection.isValid()) { if (redirection.isValid()) {
QUrl newUrl = m_reply->url().resolved(redirection);
if (newUrl == m_reply->url()) { // avoid redirecting to the same url as it causes infinite recursion
ResourceError error(newUrl.host(), 400 /*bad request*/,
newUrl.toString(),
QCoreApplication::translate("QWebPage", "Infinite recursion in redirection request"));
client->didFail(m_resourceHandle, error);
return;
}
m_redirected = true; m_redirected = true;
QUrl newUrl = m_reply->url().resolved(redirection);
ResourceRequest newRequest = m_resourceHandle->request(); ResourceRequest newRequest = m_resourceHandle->request();
newRequest.setURL(newUrl); newRequest.setURL(newUrl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment