[EFL][DRT] http/tests/loading/307-after-303-after-post.html times out
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2013 18:28:11 +0000 (18:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Feb 2013 18:28:11 +0000 (18:28 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143352 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/efl/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

index cb58936fb5b908941eeb218583c5d5ba640ab966..380de46184cddff5bfd1d5dcde8a4a8bd01fd21d 100644 (file)
@@ -1,3 +1,15 @@
+2013-02-19  Youenn Fablet  <youennf@gmail.com>
+
+        [EFL][DRT] http/tests/loading/307-after-303-after-post.html times out
+        https://bugs.webkit.org/show_bug.cgi?id=93214
+
+        Removed Failure from potential outcome of
+        http/tests/loading/307-after-303-after-post.html test.
+
+        Reviewed by Martin Robinson.
+
+        * platform/efl/TestExpectations:
+
 2013-02-19  Ádám Kallai  <kadam@inf.u-szeged.hu>
 
         [Qt] Unreviewed gardening. Skip failing test.
index 4c305c27042604f3c4c894e826717e04ee0519f8..71da9fafc4a7de08bcf39a31075090e7c3fc0ca6 100644 (file)
@@ -760,7 +760,7 @@ webkit.org/b/77631 fast/multicol/span/span-as-immediate-child-property-removal.h
 webkit.org/b/77631 fast/multicol/span/span-as-immediate-columns-child-removal.html [ Failure Pass ]
 
 webkit.org/b/93213 fast/text/international/text-spliced-font.html [ Failure Pass ]
-webkit.org/b/93214 http/tests/loading/307-after-303-after-post.html [ Crash Failure Pass Timeout ]
+webkit.org/b/93214 http/tests/loading/307-after-303-after-post.html [ Crash Pass Timeout ]
 webkit.org/b/93212 http/tests/incremental/slow-utf8-text.pl [ Pass Timeout ]
 
 webkit.org/b/85180 media/audio-delete-while-step-button-clicked.html [ Failure Pass ]
index 932dbf9c7a7164030f181395a0a942b5910d2fec..b485f425fbc3d31d9a2a006a256799a6a1d899e3 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-19  Youenn Fablet  <youennf@gmail.com>
+
+        [EFL][DRT] http/tests/loading/307-after-303-after-post.html times out
+        https://bugs.webkit.org/show_bug.cgi?id=93214
+
+        Ensured that GET verb is consistently used for any request
+        coming after a redirection that triggers switching to GET.
+
+        Reviewed by Martin Robinson.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::doRedirect):
+
 2013-02-19  Andras Becsi  <andras.becsi@digia.com>
 
         [Qt] Fix compilation if Qt was configured with -no-rtti
index 4a03cefb77b9f2a121a69221f4e7badd4db2f02e..2bb936cd8c31c77be283002944a8005014f6145b 100644 (file)
@@ -453,48 +453,52 @@ static void doRedirect(ResourceHandle* handle)
         return;
     }
 
-    ResourceRequest request = handle->firstRequest();
+    ResourceRequest newRequest = handle->firstRequest();
     SoupMessage* message = d->m_soupMessage.get();
     const char* location = soup_message_headers_get_one(message->response_headers, "Location");
     KURL newURL = KURL(soupURIToKURL(soup_message_get_uri(message)), location);
-    bool crossOrigin = !protocolHostAndPortAreEqual(request.url(), newURL);
-    request.setURL(newURL);
-
-    if (shouldRedirectAsGET(message, newURL, crossOrigin)) {
-        request.setHTTPMethod("GET");
-        request.setHTTPBody(0);
-        request.clearHTTPContentType();
+    bool crossOrigin = !protocolHostAndPortAreEqual(handle->firstRequest().url(), newURL);
+    newRequest.setURL(newURL);
+
+    if (newRequest.httpMethod() != "GET") {
+        // Change newRequest method to GET if change was made during a previous redirection
+        // or if current redirection says so
+        if (message->method == SOUP_METHOD_GET || shouldRedirectAsGET(message, newURL, crossOrigin)) {
+            newRequest.setHTTPMethod("GET");
+            newRequest.setHTTPBody(0);
+            newRequest.clearHTTPContentType();
+        }
     }
 
     // Should not set Referer after a redirect from a secure resource to non-secure one.
-    if (!newURL.protocolIs("https") && protocolIs(request.httpReferrer(), "https") && handle->context()->shouldClearReferrerOnHTTPSToHTTPRedirect())
-        request.clearHTTPReferrer();
+    if (!newURL.protocolIs("https") && protocolIs(newRequest.httpReferrer(), "https") && handle->context()->shouldClearReferrerOnHTTPSToHTTPRedirect())
+        newRequest.clearHTTPReferrer();
 
     d->m_user = newURL.user();
     d->m_pass = newURL.pass();
-    request.removeCredentials();
+    newRequest.removeCredentials();
 
     if (crossOrigin) {
         // If the network layer carries over authentication headers from the original request
         // in a cross-origin redirect, we want to clear those headers here. 
-        request.clearHTTPAuthorization();
+        newRequest.clearHTTPAuthorization();
 
         // TODO: We are losing any username and password specified in the redirect URL, as this is the 
         // same behavior as the CFNet port. We should investigate if this is really what we want.
     } else
-        applyAuthenticationToRequest(handle, request, true);
+        applyAuthenticationToRequest(handle, newRequest, true);
 
     cleanupSoupRequestOperation(handle);
-    if (!createSoupRequestAndMessageForHandle(handle, request, true)) {
+    if (!createSoupRequestAndMessageForHandle(handle, newRequest, true)) {
         d->client()->cannotShowURL(handle);
         return;
     }
 
     // If we sent credentials with this request's URL, we don't want the response to carry them to
     // the WebKit layer. They were only placed in the URL for the benefit of libsoup.
-    request.removeCredentials();
+    newRequest.removeCredentials();
 
-    d->client()->willSendRequest(handle, request, d->m_response);
+    d->client()->willSendRequest(handle, newRequest, d->m_response);
     handle->sendPendingRequest();
 }