[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

aestes at apple.com aestes at apple.com
Mon Dec 27 16:28:00 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5a0d123e07141fb51c58ea9fbca69a8b54e8ae7c
Author: aestes at apple.com <aestes at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 21 22:36:48 2010 +0000

    2010-12-21  Jian Li  <jianli at chromium.org>
    
            Reviewed by Darin Adler.
    
            Fix bug 51366: REGRESSION (r66452): Form data no longer contains
            'Content-Type' header for files with unrecognized extensions
            https://bugs.webkit.org/show_bug.cgi?id=51366
    
            Test: http/tests/local/formdata/form-data-with-unknown-file-extension.html
    
            * platform/network/FormData.cpp:
            (WebCore::FormData::appendKeyValuePairItems):
    2010-12-21  Jian Li  <jianli at chromium.org>
    
            Reviewed by Darin Adler.
    
            Fix bug 51366: REGRESSION (r66452): Form data no longer contains
            'Content-Type' header for files with unrecognized extensions
            https://bugs.webkit.org/show_bug.cgi?id=51366
    
            * http/tests/local/formdata/form-data-with-unknown-file-extension-expected.txt: Added.
            * http/tests/local/formdata/form-data-with-unknown-file-extension.html: Added.
            * http/tests/local/resources/file.invalid: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74427 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 02055d1..45c516b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-21  Jian Li  <jianli at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Fix bug 51366: REGRESSION (r66452): Form data no longer contains
+        'Content-Type' header for files with unrecognized extensions
+        https://bugs.webkit.org/show_bug.cgi?id=51366
+
+        * http/tests/local/formdata/form-data-with-unknown-file-extension-expected.txt: Added.
+        * http/tests/local/formdata/form-data-with-unknown-file-extension.html: Added.
+        * http/tests/local/resources/file.invalid: Added.
+
 2010-12-21  Tony Gentilcore  <tonyg at chromium.org>
 
         Unreviewed build fix.
diff --git a/LayoutTests/http/tests/local/formdata/form-data-with-unknown-file-extension-expected.txt b/LayoutTests/http/tests/local/formdata/form-data-with-unknown-file-extension-expected.txt
new file mode 100755
index 0000000..799c0be
--- /dev/null
+++ b/LayoutTests/http/tests/local/formdata/form-data-with-unknown-file-extension-expected.txt
@@ -0,0 +1,6 @@
+
+PASS xhr.responseText is 'file1=file.invalid:application/octet-stream:1234567890'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/http/tests/local/formdata/form-data-with-unknown-file-extension.html b/LayoutTests/http/tests/local/formdata/form-data-with-unknown-file-extension.html
new file mode 100755
index 0000000..4674aad
--- /dev/null
+++ b/LayoutTests/http/tests/local/formdata/form-data-with-unknown-file-extension.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/send-form-data-common.js"></script>
+<script>
+    function addXHREventHandlers(xhr, file) {
+        xhr.onreadystatechange = function(event) {
+            if (xhr.readyState == xhr.DONE) {
+                window.xhr = xhr;
+                shouldBe("xhr.responseText", "'file1=file.invalid:application/octet-stream:1234567890'");
+                finishJSTest();
+            }
+        }
+    }
+    
+    testSendingFormData([{'type': 'file', 'name': 'file1', 'value': '../resources/file.invalid'}], true, addXHREventHandlers);
+    var successfullyParsed = true;
+    var jsTestIsAsync = true;
+</script>
+<script src="../../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/local/resources/file-for-drag-to-send.txt b/LayoutTests/http/tests/local/resources/file.invalid
similarity index 100%
copy from LayoutTests/http/tests/local/resources/file-for-drag-to-send.txt
copy to LayoutTests/http/tests/local/resources/file.invalid
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 44d2978..30006da 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-21  Jian Li  <jianli at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Fix bug 51366: REGRESSION (r66452): Form data no longer contains
+        'Content-Type' header for files with unrecognized extensions
+        https://bugs.webkit.org/show_bug.cgi?id=51366
+
+        Test: http/tests/local/formdata/form-data-with-unknown-file-extension.html
+
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::appendKeyValuePairItems):
+
 2010-12-21  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebCore/platform/network/FormData.cpp b/WebCore/platform/network/FormData.cpp
index 406a375..b20b41a 100644
--- a/WebCore/platform/network/FormData.cpp
+++ b/WebCore/platform/network/FormData.cpp
@@ -225,9 +225,13 @@ void FormData::appendKeyValuePairItems(const FormDataList& list, const TextEncod
                 // We have to include the filename=".." part in the header, even if the filename is empty
                 FormDataBuilder::addFilenameToMultiPartHeader(header, encoding, name);
 
-                // Add the content type if it is available.
-                if (!value.blob()->type().isEmpty())
-                    FormDataBuilder::addContentTypeToMultiPartHeader(header, value.blob()->type().latin1());
+                // Add the content type if available, or "application/octet-stream" otherwise (RFC 1867).
+                String contentType;
+                if (value.blob()->type().isEmpty())
+                    contentType = "application/octet-stream";
+                else
+                    contentType = value.blob()->type();
+                FormDataBuilder::addContentTypeToMultiPartHeader(header, contentType.latin1());
             }
 
             FormDataBuilder::finishMultiPartHeader(header);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list