REGRESSION(r154977): Do not urlencode soup message on ResourceRequest::toSoupMessage()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 17:53:59 +0000 (17:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 17:53:59 +0000 (17:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120681

Patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk> on 2013-09-04
Reviewed by Martin Robinson.

Do not call soup_message_set_uri with soupURI() (url encoded uri) on
ResourceRequest::toSoupMessage().

* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageMembers):
(WebCore::ResourceRequest::updateSoupMessage):
(WebCore::ResourceRequest::toSoupMessage):
Split common code from updateSoupMessage/toSoupMessage into updateSoupMessageMembers.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/ResourceRequest.h
Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp

index eeded5c4322cf162e8bca686ecf08576e8fa9830..dafc47c27830dc135b2ce813d28a24da3330c2a6 100644 (file)
@@ -1,3 +1,20 @@
+2013-09-04  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
+
+        REGRESSION(r154977): Do not urlencode soup message on ResourceRequest::toSoupMessage()
+        https://bugs.webkit.org/show_bug.cgi?id=120681
+
+        Reviewed by Martin Robinson.
+
+        Do not call soup_message_set_uri with soupURI() (url encoded uri) on
+        ResourceRequest::toSoupMessage().
+
+        * platform/network/soup/ResourceRequest.h:
+        * platform/network/soup/ResourceRequestSoup.cpp:
+        (WebCore::ResourceRequest::updateSoupMessageMembers):
+        (WebCore::ResourceRequest::updateSoupMessage):
+        (WebCore::ResourceRequest::toSoupMessage):
+        Split common code from updateSoupMessage/toSoupMessage into updateSoupMessageMembers.
+
 2013-09-04  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
 
         [GTK] add support for subtitles on webkit2GTK
index 730a2870449fdfb097f70d0114b67f63bc1c7f38..a0d0b4c752a7548162450509bd9aaa4e2122c0d2 100644 (file)
@@ -93,6 +93,7 @@ namespace WebCore {
         bool m_acceptEncoding : 1;
         SoupMessageFlags m_soupFlags;
 
+        void updateSoupMessageMembers(SoupMessage*) const;
         void doUpdatePlatformRequest() { }
         void doUpdateResourceRequest() { }
         void doUpdatePlatformHTTPBody() { }
index 2e6b3a6406fb34e7df5a9d2c3e96e5bb53dd5f14..b5a4a0dda7022b64bde809687fd69cc77a6fb763 100644 (file)
@@ -32,6 +32,22 @@ using namespace std;
 
 namespace WebCore {
 
+void ResourceRequest::updateSoupMessageMembers(SoupMessage* soupMessage) const
+{
+    updateSoupMessageHeaders(soupMessage->request_headers);
+
+    String firstPartyString = firstPartyForCookies().string();
+    if (!firstPartyString.isEmpty()) {
+        GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
+        soup_message_set_first_party(soupMessage, firstParty.get());
+    }
+
+    soup_message_set_flags(soupMessage, m_soupFlags);
+
+    if (!acceptEncoding())
+        soup_message_disable_feature(soupMessage, SOUP_TYPE_CONTENT_DECODER);
+}
+
 void ResourceRequest::updateSoupMessageHeaders(SoupMessageHeaders* soupHeaders) const
 {
     const HTTPHeaderMap& headers = httpHeaderFields();
@@ -60,18 +76,7 @@ void ResourceRequest::updateSoupMessage(SoupMessage* soupMessage) const
     GOwnPtr<SoupURI> uri(soupURI());
     soup_message_set_uri(soupMessage, uri.get());
 
-    updateSoupMessageHeaders(soupMessage->request_headers);
-
-    String firstPartyString = firstPartyForCookies().string();
-    if (!firstPartyString.isEmpty()) {
-        GOwnPtr<SoupURI> firstParty(soup_uri_new(firstPartyString.utf8().data()));
-        soup_message_set_first_party(soupMessage, firstParty.get());
-    }
-
-    soup_message_set_flags(soupMessage, m_soupFlags);
-
-    if (!acceptEncoding())
-        soup_message_disable_feature(soupMessage, SOUP_TYPE_CONTENT_DECODER);
+    updateSoupMessageMembers(soupMessage);
 }
 
 SoupMessage* ResourceRequest::toSoupMessage() const
@@ -80,7 +85,7 @@ SoupMessage* ResourceRequest::toSoupMessage() const
     if (!soupMessage)
         return 0;
 
-    updateSoupMessage(soupMessage);
+    updateSoupMessageMembers(soupMessage);
 
     // Body data is only handled at ResourceHandleSoup::startHttp for
     // now; this is because this may not be a good place to go