2009-03-30 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2009 16:35:10 +0000 (16:35 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2009 16:35:10 +0000 (16:35 +0000)
        Reviewed by Holger Freyther.

        https://bugs.webkit.org/show_bug.cgi?id=24750
        [GTK] requests download instead of displaying page

        Use soup facilities to append parameters to the content type, to
        make that more robust;

        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::fillResponseFromMessage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@42106 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/network/soup/ResourceHandleSoup.cpp

index dd8262b..e00c0e6 100644 (file)
@@ -1,3 +1,16 @@
+2009-03-30  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24750
+        [GTK] requests download instead of displaying page
+
+        Use soup facilities to append parameters to the content type, to
+        make that more robust;
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::fillResponseFromMessage):
+
 2009-03-30  David Kilzer  <ddkilzer@apple.com>
 
         <rdar://problem/6735683> Move SECTORDER_FLAGS from Xcode project to WebCore.xcconfig
 2009-03-30  David Kilzer  <ddkilzer@apple.com>
 
         <rdar://problem/6735683> Move SECTORDER_FLAGS from Xcode project to WebCore.xcconfig
index 1b91e32..7fceea0 100644 (file)
@@ -171,17 +171,19 @@ static void fillResponseFromMessage(SoupMessage* msg, ResourceResponse* response
     contentType = contentTypes[0];
 
     if (contentTypeParameters) {
     contentType = contentTypes[0];
 
     if (contentTypeParameters) {
+        GString* parametersString = g_string_new(0);
         GHashTableIter hashTableIter;
         gpointer hashKey;
         gpointer hashValue;
 
         g_hash_table_iter_init(&hashTableIter, contentTypeParameters);
         while (g_hash_table_iter_next(&hashTableIter, &hashKey, &hashValue)) {
         GHashTableIter hashTableIter;
         gpointer hashKey;
         gpointer hashValue;
 
         g_hash_table_iter_init(&hashTableIter, contentTypeParameters);
         while (g_hash_table_iter_next(&hashTableIter, &hashKey, &hashValue)) {
-            contentType += String("; ");
-            contentType += String(static_cast<char*>(hashKey));
-            contentType += String("=");
-            contentType += String(static_cast<char*>(hashValue));
+            g_string_append(parametersString, "; ");
+            soup_header_g_string_append_param(parametersString, static_cast<char*>(hashKey), static_cast<char*>(hashValue));
         }
         }
+        contentType += String(parametersString->str);
+
+        g_string_free(parametersString, true);
         g_hash_table_destroy(contentTypeParameters);
     }
 
         g_hash_table_destroy(contentTypeParameters);
     }