Title: [188366] trunk/LayoutTests
Revision
188366
Author
[email protected]
Date
2015-08-12 17:45:56 -0700 (Wed, 12 Aug 2015)

Log Message

http/tests/security/cors-post-redirect-308.html doesn't work properly
https://bugs.webkit.org/show_bug.cgi?id=147914

Reviewed by Brady Eidson.

* http/tests/resources/redirect.php: Trying to return
code 308 without a reason phrase results in an internal server error with Apache/2.2.
While at it, also corrected the script to always set Cache-Control: no-store.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (188365 => 188366)


--- trunk/LayoutTests/ChangeLog	2015-08-13 00:40:06 UTC (rev 188365)
+++ trunk/LayoutTests/ChangeLog	2015-08-13 00:45:56 UTC (rev 188366)
@@ -1,5 +1,16 @@
 2015-08-12  Alexey Proskuryakov  <[email protected]>
 
+        http/tests/security/cors-post-redirect-308.html doesn't work properly
+        https://bugs.webkit.org/show_bug.cgi?id=147914
+
+        Reviewed by Brady Eidson.
+
+        * http/tests/resources/redirect.php: Trying to return
+        code 308 without a reason phrase results in an internal server error with Apache/2.2.
+        While at it, also corrected the script to always set Cache-Control: no-store.
+
+2015-08-12  Alexey Proskuryakov  <[email protected]>
+
         Removing an expectation for a test that's fixed.
 
         * platform/mac/TestExpectations:

Modified: trunk/LayoutTests/http/tests/resources/redirect.php (188365 => 188366)


--- trunk/LayoutTests/http/tests/resources/redirect.php	2015-08-13 00:40:06 UTC (rev 188365)
+++ trunk/LayoutTests/http/tests/resources/redirect.php	2015-08-13 00:45:56 UTC (rev 188366)
@@ -1,20 +1,28 @@
 <?php
+    function addCacheControl() {
+        # Workaround for https://bugs.webkit.org/show_bug.cgi?id=77538
+        # Caching redirects results in flakiness in tests that dump loader delegates.
+        header("Cache-Control: no-store");
+    }
+
     $url = ""
     $refresh = $_GET['refresh'];
     
     if (isset($refresh)) {
         header("HTTP/1.1 200");
         header("Refresh: $refresh; url=""
+        addCacheControl();
         return;
     }
 
     $code = $_GET['code'];
     if (!isset($code))
-        $code = 302;
-    header("HTTP/1.1 $code");
+        header("HTTP/1.1 302 Found");
+    elseif ($code == 308) {
+        # Apache 2.2 (and possibly some newer versions) cannot generate a reason string for code 308, and sends a 500 error instead.
+        header("HTTP/1.1 308 Permanent Redirect");
+    } else
+        header("HTTP/1.1 $code");
     header("Location: $url");
-
-    # Workaround for https://bugs.webkit.org/show_bug.cgi?id=77538
-    # Caching redirects results in flakiness in tests that dump loader delegates.
-    header("Cache-Control: no-store");
+    addCacheControl();
 ?>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to