Changeset 180148 in webkit


Ignore:
Timestamp:
Feb 16, 2015 9:16:16 AM (9 years ago)
Author:
Antti Koivisto
Message:

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.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r180143 r180148  
     12015-02-16  Antti Koivisto  <antti@apple.com>
     2
     3        Assertion in disk cache code with redirect to a non-http resource
     4        https://bugs.webkit.org/show_bug.cgi?id=141644
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * http/tests/cache/disk-cache-redirect-to-data-expected.txt: Added.
     9        * http/tests/cache/disk-cache-redirect-to-data.html: Added.
     10        * http/tests/cache/resources/redirect-to-data.php: Added.
     11
    1122015-02-16  Sergio Villar Senin  <svillar@igalia.com>
    213
  • trunk/Source/WebKit2/ChangeLog

    r180146 r180148  
     12015-02-16  Antti Koivisto  <antti@apple.com>
     2
     3        Assertion in disk cache code with redirect to a non-http resource
     4        https://bugs.webkit.org/show_bug.cgi?id=141644
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * NetworkProcess/NetworkResourceLoader.cpp:
     9        (WebKit::NetworkResourceLoader::didFinishLoading):
     10
     11            Check that response is HTTP before calling computeFreshnessLifetimeForHTTPFamily.
     12
     13        * NetworkProcess/cache/NetworkCache.cpp:
     14        (WebKit::canStore):
     15
     16            Deny storing non-HTTP responses to cache (though the above already covers this).
     17
    1182015-02-13  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

    r179972 r180148  
    328328        }
    329329        bool allowStale = originalRequest().cachePolicy() >= ReturnCacheDataElseLoad;
    330         bool hasCacheableRedirect = WebCore::redirectChainAllowsReuse(m_redirectChainCacheStatus, allowStale ? WebCore::ReuseExpiredRedirection : WebCore::DoNotReuseExpiredRedirection);
     330        bool hasCacheableRedirect = m_response.isHTTP() && WebCore::redirectChainAllowsReuse(m_redirectChainCacheStatus, allowStale ? WebCore::ReuseExpiredRedirection : WebCore::DoNotReuseExpiredRedirection);
    331331        if (hasCacheableRedirect && m_redirectChainCacheStatus.status == RedirectChainCacheStatus::CachedRedirection) {
    332332            // FIXME: Cache the actual redirects instead of the end result.
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp

    r179972 r180148  
    263263static bool canStore(const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceResponse& response)
    264264{
    265     if (!originalRequest.url().protocolIsInHTTPFamily()) {
     265    if (!originalRequest.url().protocolIsInHTTPFamily() || !response.isHTTP()) {
    266266        LOG(NetworkCache, "(NetworkProcess) not HTTP");
    267267        return false;
Note: See TracChangeset for help on using the changeset viewer.