Title: [155203] trunk/Source/WebCore
Revision
155203
Author
[email protected]
Date
2013-09-06 12:18:03 -0700 (Fri, 06 Sep 2013)

Log Message

2013-09-06  Mike West  <[email protected]>

        Revalidation header blacklisting should be case-insensitive.
        https://bugs.webkit.org/show_bug.cgi?id=120832

        Reviewed by Alexey Proskuryakov.

        Headers like 'content-type' should be ignored for 304 responses,
        even if they are delivered as 'Content-Type', or 'CoNtEnT-TyPe', etc.

        I broke this behavior in http://trac.webkit.org/changeset/142068
        ("Entity-header extension headers honored on 304 responses"). Pages like
        https://learndev.unm.edu/ currently break on reload, as they incorrectly
        send 'Content-Type: text/plain' for 304 responses for resources like
        CSS and _javascript_. The browser should drop these headers, but because
        we're comparing in a case-sensitive fashion, we don't.

        https://code.google.com/p/chromium/issues/detail?id=246875 documents the
        Blink-side fix; this patch is a port of that patch.

        Test: http/tests/cache/content-type-ignored-during-revalidation.html

        * loader/cache/CachedResource.cpp:
        (WebCore::shouldUpdateHeaderAfterRevalidation):
        Compare the provided AtomicString 'header' to the revalidation
        blacklists in a case-insensitive fashion.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (155202 => 155203)


--- trunk/Source/WebCore/ChangeLog	2013-09-06 19:14:35 UTC (rev 155202)
+++ trunk/Source/WebCore/ChangeLog	2013-09-06 19:18:03 UTC (rev 155203)
@@ -1,3 +1,30 @@
+2013-09-06  Mike West  <[email protected]>
+
+        Revalidation header blacklisting should be case-insensitive.
+        https://bugs.webkit.org/show_bug.cgi?id=120832
+
+        Reviewed by Alexey Proskuryakov.
+
+        Headers like 'content-type' should be ignored for 304 responses,
+        even if they are delivered as 'Content-Type', or 'CoNtEnT-TyPe', etc.
+
+        I broke this behavior in http://trac.webkit.org/changeset/142068
+        ("Entity-header extension headers honored on 304 responses"). Pages like
+        https://learndev.unm.edu/ currently break on reload, as they incorrectly
+        send 'Content-Type: text/plain' for 304 responses for resources like
+        CSS and _javascript_. The browser should drop these headers, but because
+        we're comparing in a case-sensitive fashion, we don't.
+
+        https://code.google.com/p/chromium/issues/detail?id=246875 documents the
+        Blink-side fix; this patch is a port of that patch.
+
+        Test: http/tests/cache/content-type-ignored-during-revalidation.html
+
+        * loader/cache/CachedResource.cpp:
+        (WebCore::shouldUpdateHeaderAfterRevalidation):
+        Compare the provided AtomicString 'header' to the revalidation
+        blacklists in a case-insensitive fashion.
+
 2013-09-06  Eric Carlson  <[email protected]>
 
         [MediaStream API] Allow empty MediaStreams

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (155202 => 155203)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2013-09-06 19:14:35 UTC (rev 155202)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2013-09-06 19:18:03 UTC (rev 155203)
@@ -90,11 +90,11 @@
 static inline bool shouldUpdateHeaderAfterRevalidation(const AtomicString& header)
 {
     for (size_t i = 0; i < WTF_ARRAY_LENGTH(headersToIgnoreAfterRevalidation); i++) {
-        if (header == headersToIgnoreAfterRevalidation[i])
+        if (equalIgnoringCase(header, headersToIgnoreAfterRevalidation[i]))
             return false;
     }
     for (size_t i = 0; i < WTF_ARRAY_LENGTH(headerPrefixesToIgnoreAfterRevalidation); i++) {
-        if (header.startsWith(headerPrefixesToIgnoreAfterRevalidation[i]))
+        if (header.startsWith(headerPrefixesToIgnoreAfterRevalidation[i], false))
             return false;
     }
     return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to