Assertion in disk cache code with redirect to a non-http resource
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Feb 2015 17:16:16 +0000 (17:16 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Feb 2015 17:16:16 +0000 (17:16 +0000)
commit142324bd6da0ea1e382e19831951af35592fb4b3
treef08672fa7f03d007d720c88ed767bcb1f6b1b20b
parent824d2a9b0bb27d7232f077d3471082c7619b0129
Assertion in disk cache code with redirect to a non-http resource
https://bugs.webkit.org/show_bug.cgi?id=141644

Reviewed by Anders Carlsson.

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):

    Check that response is HTTP before calling computeFreshnessLifetimeForHTTPFamily.

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

    Deny storing non-HTTP responses to cache (though the above already covers this).

LayoutTests:

* http/tests/cache/disk-cache-redirect-to-data-expected.txt: Added.
* http/tests/cache/disk-cache-redirect-to-data.html: Added.
* http/tests/cache/resources/redirect-to-data.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/disk-cache-redirect-to-data-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache-redirect-to-data.html [new file with mode: 0644]
LayoutTests/http/tests/cache/resources/redirect-to-data.php [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp