Changeset 68906 in webkit


Ignore:
Timestamp:
Oct 1, 2010 11:40:19 AM (14 years ago)
Author:
robert@webkit.org
Message:

2010-10-01 Robert Hogan <robert@webkit.org>

Reviewed by Adam Barth.

[Qt] Fix http/tests/loading/redirect-methods.html

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

Unskip http/tests/loading/redirect-methods.html

  • platform/qt/Skipped:

2010-10-01 Robert Hogan <robert@webkit.org>

Reviewed by Adam Barth.

[Qt] Fix http/tests/loading/redirect-methods.html

Document our redirection behaviour too.

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

  • platform/network/qt/QNetworkReplyHandler.cpp: (WebCore::QNetworkReplyHandler::QNetworkReplyHandler): (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
  • platform/network/qt/QNetworkReplyHandler.h:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r68904 r68906  
     12010-10-01  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] Fix http/tests/loading/redirect-methods.html
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=41571
     8
     9        Unskip http/tests/loading/redirect-methods.html
     10 
     11        * platform/qt/Skipped:
     12
    1132010-09-30  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/LayoutTests/platform/qt/Skipped

    r68872 r68906  
    182182# https://bugs.webkit.org/show_bug.cgi?id=44282
    183183http/tests/incremental/slow-utf8-text.pl
    184 
    185 # webkit.org/b/41571
    186 http/tests/loading/redirect-methods.html
    187184
    188185# expected results need updating
  • trunk/WebCore/ChangeLog

    r68905 r68906  
     12010-10-01  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] Fix http/tests/loading/redirect-methods.html
     6
     7        Document our redirection behaviour too.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=41571
     10
     11        * platform/network/qt/QNetworkReplyHandler.cpp:
     12        (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
     13        (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
     14        * platform/network/qt/QNetworkReplyHandler.h:
     15
    1162010-10-01  Adam Roben  <aroben@apple.com>
    217
  • trunk/WebCore/platform/network/qt/QNetworkReplyHandler.cpp

    r68510 r68906  
    136136{
    137137    return true;
     138}
     139
     140static QString httpMethodString(QNetworkAccessManager::Operation method)
     141{
     142    switch (method) {
     143    case QNetworkAccessManager::GetOperation:
     144        return "GET";
     145    case QNetworkAccessManager::HeadOperation:
     146        return "HEAD";
     147    case QNetworkAccessManager::PostOperation:
     148        return "POST";
     149    case QNetworkAccessManager::PutOperation:
     150        return "PUT";
     151#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     152    case QNetworkAccessManager::DeleteOperation:
     153        return "DELETE";
     154#endif
     155#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
     156    case QNetworkAccessManager::CustomOperation:
     157        return "OPTIONS";
     158#endif
     159    default:
     160        return "GET";
     161    }
    138162}
    139163
     
    360384        m_redirected = true;
    361385
     386
     387        //  Status Code 301 (Moved Permanently), 302 (Moved Temporarily), 303 (See Other):
     388        //    - If original request is POST convert to GET and redirect automatically
     389        //  Status Code 307 (Temporary Redirect) and all other redirect status codes:
     390        //    - Use the HTTP method from the previous request
     391        if ((statusCode >= 301 && statusCode <= 303) && m_resourceHandle->firstRequest().httpMethod() == "POST")
     392            m_method = QNetworkAccessManager::GetOperation;
     393
    362394        ResourceRequest newRequest = m_resourceHandle->firstRequest();
     395        newRequest.setHTTPMethod(httpMethodString(m_method));
    363396        newRequest.setURL(newUrl);
    364 
    365         if (((statusCode >= 301 && statusCode <= 303) || statusCode == 307) && newRequest.httpMethod() == "POST") {
    366             m_method = QNetworkAccessManager::GetOperation;
    367             newRequest.setHTTPMethod("GET");
    368         }
    369397
    370398        // Should not set Referer after a redirect from a secure resource to non-secure one.
Note: See TracChangeset for help on using the changeset viewer.