2009-02-20 Gustavo Noronha Silva <gns@gnome.org>
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Feb 2009 20:10:44 +0000 (20:10 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Feb 2009 20:10:44 +0000 (20:10 +0000)
        Reviewed by Holger Freyther.

        When dealing with local files, use a path instead of an URI. GFile
        has problems decoding URIs with percent signs on them.

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

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

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

index d875bd493aab54e386af14f9905c2ba67b1025f8..4471b0b946c29e910dd7ed3efdbecdb65a65b498 100644 (file)
@@ -1,3 +1,13 @@
+2009-02-20  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        When dealing with local files, use a path instead of an URI. GFile
+        has problems decoding URIs with percent signs on them.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::ResourceHandle::startGio):
+
 2009-02-20  Gustavo Noronha Silva  <gns@gnome.org>
 
         Reviewed by Holger Freyther.
index 189c2157c363c577ba4418d33dcc08d7480537ff..3c480523e3d3a9013fb96cb84375b4099cfbe01c 100644 (file)
@@ -754,7 +754,13 @@ bool ResourceHandle::startGio(KURL url)
     url.setQuery(String());
     url.setPort(0);
 
-    d->m_gfile = g_file_new_for_uri(url.string().utf8().data());
+    // we avoid the escaping for local files, because
+    // g_filename_from_uri (used internally by GFile) has problems
+    // decoding strings with arbitrary percent signs
+    if (url.isLocalFile())
+        d->m_gfile = g_file_new_for_path(url.prettyURL().utf8().data() + sizeof("file://") - 1);
+    else
+        d->m_gfile = g_file_new_for_uri(url.string().utf8().data());
     g_object_set_data(G_OBJECT(d->m_gfile), "webkit-resource", this);
     d->m_cancellable = g_cancellable_new();
     g_file_query_info_async(d->m_gfile,