[WK2] Responses with 204 HTTP Status Code should be cacheable by default
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 23:46:03 +0000 (23:46 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2015 23:46:03 +0000 (23:46 +0000)
commita92ad78878df9fd7bca6c397ad770bf5f4291d11
tree29bd915b59c8c6cd7b33653f8340272da584b7ba
parent4e430b8fb69edb85cd6ec3269fa73b5ce5826ce5
[WK2] Responses with 204 HTTP Status Code should be cacheable by default
https://bugs.webkit.org/show_bug.cgi?id=143020
<rdar://problem/20281529>

Reviewed by Antti Koivisto.

Source/WebKit2:

Make responses with 204 HTTP Status Code cacheable by default, as
per RFC 7231:
http://tools.ietf.org/html/rfc7231#section-6.3.5

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

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

LayoutTests:

Add test to make sure that responses with 204 HTTP Status Code are
cacheable by default.

* http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-204-status-code.html: Added.
* http/tests/cache/disk-cache/resources/cache-test.js:
Re-introduce support for generating responses with only headers (no body).
This was mistakenly dropped when I rebased my patch for r181895.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/disk-cache-204-status-code.html [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-no-body.html
LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js
LayoutTests/http/tests/cache/disk-cache/resources/generate-response-no-body.cgi [deleted file]
LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp