[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

kov at webkit.org kov at webkit.org
Fri Feb 26 22:22:54 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 7360266008f0ef0ebca98be1efe3e57aad0e6b3b
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 17 14:30:11 2010 +0000

    2010-02-17 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
    
            Reviewed by Xan Lopez.
    
            Does not send an Accept header for subresources, causing some sites to break
            https://bugs.webkit.org/show_bug.cgi?id=33242
    
            Set */* as the Accept header when downloading resources
            that did not set an Accept header. This behaviour is similar to
            the one adopted by Chromium.
    
            Test: http/tests/misc/image-checks-for-accept.html
    
            * platform/network/soup/ResourceHandleSoup.cpp:
            (WebCore::startHttp):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54892 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d3d3608..dd409e0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,18 @@
 2010-02-17  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
 
+        Reviewed by Xan Lopez.
+
+        Does not send an Accept header for subresources, causing some sites to break
+        https://bugs.webkit.org/show_bug.cgi?id=33242
+
+        * http/tests/misc/image-checks-for-accept-expected.txt: Added.
+        * http/tests/misc/image-checks-for-accept.html: Added.
+        * http/tests/misc/resources/image-checks-for-accept.php: Added.
+        * platform/mac/Skipped:
+        * platform/win/Skipped:
+
+2010-02-17  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
+
         Skip a number of new tests.
 
         * platform/gtk/Skipped:
diff --git a/LayoutTests/http/tests/misc/image-checks-for-accept-expected.txt b/LayoutTests/http/tests/misc/image-checks-for-accept-expected.txt
new file mode 100644
index 0000000..a8557d4
--- /dev/null
+++ b/LayoutTests/http/tests/misc/image-checks-for-accept-expected.txt
@@ -0,0 +1,3 @@
+Tests that a subresource is loaded if the server expects an Accept header to provide it.
+
+PASS
diff --git a/LayoutTests/http/tests/misc/image-checks-for-accept.html b/LayoutTests/http/tests/misc/image-checks-for-accept.html
new file mode 100644
index 0000000..d6f2706
--- /dev/null
+++ b/LayoutTests/http/tests/misc/image-checks-for-accept.html
@@ -0,0 +1,29 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText()
+        layoutTestController.waitUntilDone();
+    }
+
+    function test() {
+        var image = document.getElementById("testImage");
+        var result = document.getElementById("result");
+
+        if (image.width == 128 && image.height == 128)
+            result.innerHTML = "PASS";
+        else
+            result.innerHTML = "FAIL";
+
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+</script>
+</head>
+<body>
+Tests that a subresource is loaded if the server expects an Accept
+header to provide it.<br>
+<img id="testImage" src="resources/image-checks-for-accept.php"  onload="test()" onerror="test()"/>
+<div id="result"/>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/misc/resources/image-checks-for-accept.php b/LayoutTests/http/tests/misc/resources/image-checks-for-accept.php
new file mode 100644
index 0000000..459c416
--- /dev/null
+++ b/LayoutTests/http/tests/misc/resources/image-checks-for-accept.php
@@ -0,0 +1,13 @@
+<?php
+    if($_SERVER["HTTP_ACCEPT"] == "*/*" || $_SERVER["HTTP_ACCEPT"] == "image/*" || $_SERVER["HTTP_ACCEPT"] == "image/jpg")
+    {
+        header("Content-Type: image/jpg");
+        header("Cache-Control: no-store");
+        header("Connection: close");
+
+        $fn = fopen("compass.jpg", "r");
+        fpassthru($fn);
+        fclose($fn);
+        exit;
+    }
+?>
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index c4639f8..0572cdb 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -115,3 +115,6 @@ http/tests/media/video-referer.html
 # Fails intermittently on Leopard and Tiger.
 # https://bugs.webkit.org/show_bug.cgi?id=29154
 storage/database-lock-after-reload.html
+
+# Accept header is handled by the browser
+http/tests/misc/image-checks-for-accept.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 7179071..037f600 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -765,3 +765,6 @@ media/video-display-aspect-ratio.html
 
 # https://bugs.webkit.org/show_bug.cgi?id=34865
 fast/text/glyph-reordering.html
+
+# Accept header is handled by the browser
+http/tests/misc/image-checks-for-accept.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7452d5c..c5d1ad6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-02-17 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        Does not send an Accept header for subresources, causing some sites to break
+        https://bugs.webkit.org/show_bug.cgi?id=33242
+
+        Set */* as the Accept header when downloading resources
+        that did not set an Accept header. This behaviour is similar to
+        the one adopted by Chromium.
+
+        Test: http/tests/misc/image-checks-for-accept.html
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::startHttp):
+
 2010-02-17  Marcus Bulach  <bulach at chromium.org>
 
         Reviewed by Jeremy Orlow.
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index f67f5ce..ca6921c 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -573,6 +573,11 @@ static bool startHttp(ResourceHandle* handle)
     // balanced by a deref() in finishedCallback, which should always run
     handle->ref();
 
+    // Make sure we have an Accept header for subresources; some sites
+    // want this to serve some of their subresources
+    if (!soup_message_headers_get_one(d->m_msg->request_headers, "Accept"))
+        soup_message_headers_append(d->m_msg->request_headers, "Accept", "*/*");
+
     // Balanced in ResourceHandleInternal's destructor; we need to
     // keep our own ref, because after queueing the message, the
     // session owns the initial reference.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list