Changeset 200849 in webkit


Ignore:
Timestamp:
May 13, 2016, 5:59:02 AM (9 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r200326 - Do not reuse cache entries with conditional headers
https://bugs.webkit.org/show_bug.cgi?id=157205
rdar://problem/25856933

Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/xmlhttprequest/if-modified-since-0.html

  • loader/cache/CachedRawResource.cpp:

(WebCore::CachedRawResource::canReuse):
CachedResourceLoader::determineRevalidationPolicy asserts that the request is not conditional,
which means that it does not have any headers like If-Modified-Since. They are usually different,
because we put the timestamp in the If-Modified-Since header, so it fails the canReuse test because
time has passed since the last If-Modified-Since header was sent. When a user sets the If-Modified-Since
manually to something that is constant, we reuse cache entries when we should not.

  • platform/network/mac/WebCoreResourceHandleAsDelegate.mm:

(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
Set the source so we can use it in Internals.

LayoutTests:

  • http/tests/xmlhttprequest/if-modified-since-0-expected.txt: Added.
  • http/tests/xmlhttprequest/if-modified-since-0.html: Added.
Location:
releases/WebKitGTK/webkit-2.12
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog

    r200848 r200849  
     12016-04-29  Alex Christensen  <achristensen@webkit.org>
     2
     3        Do not reuse cache entries with conditional headers
     4        https://bugs.webkit.org/show_bug.cgi?id=157205
     5        rdar://problem/25856933
     6
     7        Reviewed by Chris Dumez.
     8
     9        * http/tests/xmlhttprequest/if-modified-since-0-expected.txt: Added.
     10        * http/tests/xmlhttprequest/if-modified-since-0.html: Added.
     11
    1122016-04-30  Zalan Bujtas  <zalan@apple.com>
    213
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog

    r200848 r200849  
     12016-04-29  Alex Christensen  <achristensen@webkit.org>
     2
     3        Do not reuse cache entries with conditional headers
     4        https://bugs.webkit.org/show_bug.cgi?id=157205
     5        rdar://problem/25856933
     6
     7        Reviewed by Chris Dumez.
     8
     9        Test: http/tests/xmlhttprequest/if-modified-since-0.html
     10
     11        * loader/cache/CachedRawResource.cpp:
     12        (WebCore::CachedRawResource::canReuse):
     13        CachedResourceLoader::determineRevalidationPolicy asserts that the request is not conditional,
     14        which means that it does not have any headers like If-Modified-Since.  They are usually different,
     15        because we put the timestamp in the If-Modified-Since header, so it fails the canReuse test because
     16        time has passed since the last If-Modified-Since header was sent.  When a user sets the If-Modified-Since
     17        manually to something that is constant, we reuse cache entries when we should not.
     18        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
     19        (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
     20        Set the source so we can use it in Internals.
     21
    1222016-04-30  Zalan Bujtas  <zalan@apple.com>
    223
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/loader/cache/CachedRawResource.cpp

    r191369 r200849  
    245245        return false;
    246246
     247    if (newRequest.isConditional())
     248        return false;
     249
    247250    // Ensure most headers match the existing headers before continuing.
    248251    // Note that the list of ignored headers includes some headers explicitly related to caching.
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm

    r194472 r200849  
    143143- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)r
    144144{
    145 #if !PLATFORM(IOS)
    146     UNUSED_PARAM(connection);
    147 #endif
    148 
    149145    LOG(Network, "Handle %p delegate connection:%p didReceiveResponse:%p (HTTP status %d, reported MIMEType '%s')", m_handle, connection, r, [r respondsToSelector:@selector(statusCode)] ? [(id)r statusCode] : 0, [[r MIMEType] UTF8String]);
    150146
     
    169165   
    170166    ResourceResponse resourceResponse(r);
     167    resourceResponse.setSource(ResourceResponse::Source::Network);
    171168#if ENABLE(WEB_TIMING)
    172169    ResourceHandle::getConnectionTimingData(connection, resourceResponse.resourceLoadTiming());
Note: See TracChangeset for help on using the changeset viewer.