Changeset 143352 in webkit


Ignore:
Timestamp:
Feb 19, 2013 10:28:11 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][DRT] http/tests/loading/307-after-303-after-post.html times out
https://bugs.webkit.org/show_bug.cgi?id=93214

Source/WebCore:

Ensured that GET verb is consistently used for any request
coming after a redirection that triggers switching to GET.

Patch by Youenn Fablet <youennf@gmail.com> on 2013-02-19
Reviewed by Martin Robinson.

  • platform/network/soup/ResourceHandleSoup.cpp:

(WebCore::doRedirect):

LayoutTests:

Removed Failure from potential outcome of
http/tests/loading/307-after-303-after-post.html test.

Patch by Youenn Fablet <youennf@gmail.com> on 2013-02-19
Reviewed by Martin Robinson.

  • platform/efl/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143342 r143352  
     12013-02-19  Youenn Fablet  <youennf@gmail.com>
     2
     3        [EFL][DRT] http/tests/loading/307-after-303-after-post.html times out
     4        https://bugs.webkit.org/show_bug.cgi?id=93214
     5
     6        Removed Failure from potential outcome of
     7        http/tests/loading/307-after-303-after-post.html test.
     8
     9        Reviewed by Martin Robinson.
     10
     11        * platform/efl/TestExpectations:
     12
    1132013-02-19  Ádám Kallai  <kadam@inf.u-szeged.hu>
    214
  • trunk/LayoutTests/platform/efl/TestExpectations

    r143214 r143352  
    761761
    762762webkit.org/b/93213 fast/text/international/text-spliced-font.html [ Failure Pass ]
    763 webkit.org/b/93214 http/tests/loading/307-after-303-after-post.html [ Crash Failure Pass Timeout ]
     763webkit.org/b/93214 http/tests/loading/307-after-303-after-post.html [ Crash Pass Timeout ]
    764764webkit.org/b/93212 http/tests/incremental/slow-utf8-text.pl [ Pass Timeout ]
    765765
  • trunk/Source/WebCore/ChangeLog

    r143350 r143352  
     12013-02-19  Youenn Fablet  <youennf@gmail.com>
     2
     3        [EFL][DRT] http/tests/loading/307-after-303-after-post.html times out
     4        https://bugs.webkit.org/show_bug.cgi?id=93214
     5
     6        Ensured that GET verb is consistently used for any request
     7        coming after a redirection that triggers switching to GET.
     8
     9        Reviewed by Martin Robinson.
     10
     11        * platform/network/soup/ResourceHandleSoup.cpp:
     12        (WebCore::doRedirect):
     13
    1142013-02-19  Andras Becsi  <andras.becsi@digia.com>
    215
  • trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r143329 r143352  
    454454    }
    455455
    456     ResourceRequest request = handle->firstRequest();
     456    ResourceRequest newRequest = handle->firstRequest();
    457457    SoupMessage* message = d->m_soupMessage.get();
    458458    const char* location = soup_message_headers_get_one(message->response_headers, "Location");
    459459    KURL newURL = KURL(soupURIToKURL(soup_message_get_uri(message)), location);
    460     bool crossOrigin = !protocolHostAndPortAreEqual(request.url(), newURL);
    461     request.setURL(newURL);
    462 
    463     if (shouldRedirectAsGET(message, newURL, crossOrigin)) {
    464         request.setHTTPMethod("GET");
    465         request.setHTTPBody(0);
    466         request.clearHTTPContentType();
     460    bool crossOrigin = !protocolHostAndPortAreEqual(handle->firstRequest().url(), newURL);
     461    newRequest.setURL(newURL);
     462
     463    if (newRequest.httpMethod() != "GET") {
     464        // Change newRequest method to GET if change was made during a previous redirection
     465        // or if current redirection says so
     466        if (message->method == SOUP_METHOD_GET || shouldRedirectAsGET(message, newURL, crossOrigin)) {
     467            newRequest.setHTTPMethod("GET");
     468            newRequest.setHTTPBody(0);
     469            newRequest.clearHTTPContentType();
     470        }
    467471    }
    468472
    469473    // Should not set Referer after a redirect from a secure resource to non-secure one.
    470     if (!newURL.protocolIs("https") && protocolIs(request.httpReferrer(), "https") && handle->context()->shouldClearReferrerOnHTTPSToHTTPRedirect())
    471         request.clearHTTPReferrer();
     474    if (!newURL.protocolIs("https") && protocolIs(newRequest.httpReferrer(), "https") && handle->context()->shouldClearReferrerOnHTTPSToHTTPRedirect())
     475        newRequest.clearHTTPReferrer();
    472476
    473477    d->m_user = newURL.user();
    474478    d->m_pass = newURL.pass();
    475     request.removeCredentials();
     479    newRequest.removeCredentials();
    476480
    477481    if (crossOrigin) {
    478482        // If the network layer carries over authentication headers from the original request
    479483        // in a cross-origin redirect, we want to clear those headers here.
    480         request.clearHTTPAuthorization();
     484        newRequest.clearHTTPAuthorization();
    481485
    482486        // TODO: We are losing any username and password specified in the redirect URL, as this is the
    483487        // same behavior as the CFNet port. We should investigate if this is really what we want.
    484488    } else
    485         applyAuthenticationToRequest(handle, request, true);
     489        applyAuthenticationToRequest(handle, newRequest, true);
    486490
    487491    cleanupSoupRequestOperation(handle);
    488     if (!createSoupRequestAndMessageForHandle(handle, request, true)) {
     492    if (!createSoupRequestAndMessageForHandle(handle, newRequest, true)) {
    489493        d->client()->cannotShowURL(handle);
    490494        return;
     
    493497    // If we sent credentials with this request's URL, we don't want the response to carry them to
    494498    // the WebKit layer. They were only placed in the URL for the benefit of libsoup.
    495     request.removeCredentials();
    496 
    497     d->client()->willSendRequest(handle, request, d->m_response);
     499    newRequest.removeCredentials();
     500
     501    d->client()->willSendRequest(handle, newRequest, d->m_response);
    498502    handle->sendPendingRequest();
    499503}
Note: See TracChangeset for help on using the changeset viewer.