Title: [181926] trunk
Revision
181926
Author
[email protected]
Date
2015-03-24 19:18:10 -0700 (Tue, 24 Mar 2015)

Log Message

[WK2] Responses with 302 HTTP Status Code should not be cached
https://bugs.webkit.org/show_bug.cgi?id=143028
<rdar://problem/19714040>

Reviewed by Antti Koivisto.

Source/WebKit2:

Responses with 302 HTTP Status Code should not be cached as per
RFC 7231:
http://tools.ietf.org/html/rfc7231#section-6.1

This patch updates our disk cache policy accordingly.

Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canStore):

LayoutTests:

Add layout test to check that responses with 302 HTTP Status Code
are not cached.

* http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-302-status-code.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (181925 => 181926)


--- trunk/LayoutTests/ChangeLog	2015-03-25 01:28:28 UTC (rev 181925)
+++ trunk/LayoutTests/ChangeLog	2015-03-25 02:18:10 UTC (rev 181926)
@@ -1,3 +1,17 @@
+2015-03-24  Chris Dumez  <[email protected]>
+
+        [WK2] Responses with 302 HTTP Status Code should not be cached
+        https://bugs.webkit.org/show_bug.cgi?id=143028
+        <rdar://problem/19714040>
+
+        Reviewed by Antti Koivisto.
+
+        Add layout test to check that responses with 302 HTTP Status Code
+        are not cached.
+
+        * http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt: Added.
+        * http/tests/cache/disk-cache/disk-cache-302-status-code.html: Added.
+
 2015-03-24  Zhuo Li  <[email protected]>
 
         Scripts running in isolated world should not subject to a page's CSP about 'eval'.

Added: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt (0 => 181926)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt	2015-03-25 02:18:10 UTC (rev 181926)
@@ -0,0 +1,17 @@
+Test that responses with HTTP status code 302 are not cached
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+running 2 tests
+
+response headers: {"Status":"302","Location":"/","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"302","Location":"/","Cache-control":"max-age=100"}
+response source: Network
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code.html (0 => 181926)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code.html	2015-03-25 02:18:10 UTC (rev 181926)
@@ -0,0 +1,20 @@
+<script src=""
+<script src=""
+<body>
+<script>
+
+var tests =
+[
+ { responseHeaders: {'Status': '302', 'Location': '/', 'Cache-control': 'max-age=0' }, includeBody: false },
+ { responseHeaders: {'Status': '302', 'Location': '/', 'Cache-control': 'max-age=100' }, includeBody: false },
+];
+
+description("Test that responses with HTTP status code 302 are not cached");
+
+debug("running " + tests.length + " tests");
+debug("");
+
+runTests(tests);
+
+</script>
+<script src=""

Modified: trunk/Source/WebKit2/ChangeLog (181925 => 181926)


--- trunk/Source/WebKit2/ChangeLog	2015-03-25 01:28:28 UTC (rev 181925)
+++ trunk/Source/WebKit2/ChangeLog	2015-03-25 02:18:10 UTC (rev 181926)
@@ -1,3 +1,22 @@
+2015-03-24  Chris Dumez  <[email protected]>
+
+        [WK2] Responses with 302 HTTP Status Code should not be cached
+        https://bugs.webkit.org/show_bug.cgi?id=143028
+        <rdar://problem/19714040>
+
+        Reviewed by Antti Koivisto.
+
+        Responses with 302 HTTP Status Code should not be cached as per
+        RFC 7231:
+        http://tools.ietf.org/html/rfc7231#section-6.1
+
+        This patch updates our disk cache policy accordingly.
+
+        Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
+
+        * NetworkProcess/cache/NetworkCache.cpp:
+        (WebKit::NetworkCache::canStore):
+
 2015-03-24  Anders Carlsson  <[email protected]>
 
         Fix crash in WebKit::RemoteObjectRegistry::sendInvocation

Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (181925 => 181926)


--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp	2015-03-25 01:28:28 UTC (rev 181925)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp	2015-03-25 02:18:10 UTC (rev 181926)
@@ -324,7 +324,6 @@
     case 204: // No Content
     case 300: // Multiple Choices
     case 301: // Moved Permanently
-    case 302: // Found
     case 307: // Temporary Redirect
     case 404: // Not Found
     case 410: // Gone
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to