[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

mjs at apple.com mjs at apple.com
Thu Oct 29 20:37:09 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 67d34954aacd066c95916fe4053bc7b2cea41dc7
Author: mjs at apple.com <mjs at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 1 01:09:09 2009 +0000

    2009-09-30  Maciej Stachowiak  <mjs at apple.com>
    
            Reviewed by Brady Eidson.
    
            307 redirects should pass along http body and Content-Type header
            https://bugs.webkit.org/show_bug.cgi?id=29943
    
            Follow-up fix for:
            <rdar://problem/3802660> SAP: 307 (Temporary Redirect) responses should use POST, not GET
    
            Test: http/tests/loading/resources/redirect-methods-result.php
    
            * platform/network/cf/ResourceHandleCFNet.cpp:
            (WebCore::willSendRequest): Pass along http body and Content-Type header.
            * platform/network/mac/ResourceHandleMac.mm:
            (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): ditto
    2009-09-30  Maciej Stachowiak  <mjs at apple.com>
    
            Reviewed by Brady Eidson.
    
            307 redirects should pass along http body and Content-Type header
            https://bugs.webkit.org/show_bug.cgi?id=29943
    
            Follow-up fix for:
            <rdar://problem/3802660> SAP: 307 (Temporary Redirect) responses should use POST, not GET
    
            * http/tests/loading/redirect-methods.html: Updated test to show the http body and content-type header.
            * http/tests/loading/redirect-methods-expected.txt:
            * http/tests/loading/resources/redirect-methods-result.php:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48953 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a971766..823eafb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2009-09-30  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Brady Eidson.
+
+        307 redirects should pass along http body and Content-Type header
+        https://bugs.webkit.org/show_bug.cgi?id=29943
+
+        Follow-up fix for:
+        <rdar://problem/3802660> SAP: 307 (Temporary Redirect) responses should use POST, not GET
+
+        * http/tests/loading/redirect-methods.html: Updated test to show the http body and content-type header.
+        * http/tests/loading/redirect-methods-expected.txt:
+        * http/tests/loading/resources/redirect-methods-result.php: 
+
 2009-09-30  Jeremy Orlow  <jorlow at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/LayoutTests/http/tests/loading/redirect-methods-expected.txt b/LayoutTests/http/tests/loading/redirect-methods-expected.txt
index 110fd2d..8ada636 100644
--- a/LayoutTests/http/tests/loading/redirect-methods-expected.txt
+++ b/LayoutTests/http/tests/loading/redirect-methods-expected.txt
@@ -117,4 +117,15 @@ frame "3" - didHandleOnloadEventsForFrame
 frame "3" - didFinishLoadForFrame
 This test checks to see what HTTP method is used to fetch the final resource in the case where the first request results in a redirect.
 301, 302, 303, and 307 http redirects are all tested.
+301 redirect
+
+
+302 redirect
+
+
+303 redirect
+
+
+307 redirect
+
 
diff --git a/LayoutTests/http/tests/loading/redirect-methods.html b/LayoutTests/http/tests/loading/redirect-methods.html
index d4497b0..9430ede 100644
--- a/LayoutTests/http/tests/loading/redirect-methods.html
+++ b/LayoutTests/http/tests/loading/redirect-methods.html
@@ -15,9 +15,13 @@ var testCodes = [301, 302, 303, 307];
 
 function createFrame(index)
 {
+    var h4 = document.createElement("h4");
+    h4.innerHTML = testCodes[index] + " redirect";
+    document.body.appendChild(h4);
     var iframe = document.createElement("iframe");
     iframe.setAttribute("testCode", testCodes[index]);
     iframe.setAttribute("id", index);
+    iframe.setAttribute("height", "90px");
     document.body.appendChild(iframe);
     iframe.src="resources/redirect-methods-form.html";
     iframe.setAttribute("onload", "iframeLoaded(" + index + ");");
diff --git a/LayoutTests/http/tests/loading/resources/redirect-methods-result.php b/LayoutTests/http/tests/loading/resources/redirect-methods-result.php
index 775ed30..c27886b 100644
--- a/LayoutTests/http/tests/loading/resources/redirect-methods-result.php
+++ b/LayoutTests/http/tests/loading/resources/redirect-methods-result.php
@@ -5,4 +5,6 @@ if ($status > 200 && !$_GET['redirected']) {
   exit();
 }
 ?>
-This page loaded using the <?php echo $_SERVER['REQUEST_METHOD'] ?> method.
+Request Method: <?php echo $_SERVER['REQUEST_METHOD'] ?><br> 
+Request Body: <?php echo @file_get_contents('php://input') ?><br>
+Request Content-Type: <?php echo $_SERVER["CONTENT_TYPE"]; ?>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index edc9450..517d8a8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2009-09-30  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Brady Eidson.
+
+        307 redirects should pass along http body and Content-Type header
+        https://bugs.webkit.org/show_bug.cgi?id=29943
+
+        Follow-up fix for:
+        <rdar://problem/3802660> SAP: 307 (Temporary Redirect) responses should use POST, not GET
+        
+        Test: http/tests/loading/resources/redirect-methods-result.php
+
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::willSendRequest): Pass along http body and Content-Type header.
+        * platform/network/mac/ResourceHandleMac.mm:
+        (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): ditto
+
 2009-09-30  Geoffrey Garen  <ggaren at apple.com>
 
         Reviewed by Mark Rowe.
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index cd309a9..8261e44 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -139,6 +139,15 @@ CFURLRequestRef willSendRequest(CFURLConnectionRef conn, CFURLRequestRef cfReque
             if (CFStringCompareWithOptions(originalMethod.get(), newMethod.get(), CFRangeMake(0, CFStringGetLength(originalMethod.get())), kCFCompareCaseInsensitive)) {
                 RetainPtr<CFMutableURLRequestRef> mutableRequest(AdoptCF, CFURLRequestCreateMutableCopy(0, cfRequest));
                 CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), originalMethod.get());
+
+                FormData* body = handle->request().httpBody();
+                if (!equalIgnoringCase(handle->request().httpMethod(), "GET") && body && !body->isEmpty())
+                    WebCore::setHTTPBody(mutableRequest, body);
+
+                String originalContentType = m_handle->request.httpContentType();
+                if (!originalContentType->isEmpty())
+                    CFURLRequestSetHTTPHeaderFieldValue(mutableRequest.get(), CFSTR("Content-Type"), originalContentType);
+
                 request = mutableRequest.get();
             }
         }
diff --git a/WebCore/platform/network/mac/ResourceHandleMac.mm b/WebCore/platform/network/mac/ResourceHandleMac.mm
index d0cda03..ec60079 100644
--- a/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -605,6 +605,15 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
         if (!equalIgnoringCase(originalMethod, String([newRequest HTTPMethod]))) {
             NSMutableURLRequest *mutableRequest = [newRequest mutableCopy];
             [mutableRequest setHTTPMethod:originalMethod];
+    
+            FormData* body = m_handle->request().httpBody();
+            if (!equalIgnoringCase(originalMethod, "GET") && body && !body->isEmpty())
+                WebCore::setHTTPBody(mutableRequest, body);
+
+            String originalContentType = m_handle->request().httpContentType();
+            if (!originalContentType.isEmpty())
+                [mutableRequest setValue:originalContentType forHTTPHeaderField:@"Content-Type"];
+
             newRequest = [mutableRequest autorelease];
         }
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list