Reviewed by Darin.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 19:33:12 +0000 (19:33 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 19:33:12 +0000 (19:33 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=16701
        <rdar://problem/5666580> REGRESSION: URL-encoded space (%20) in livejournal url
        causes page load error

        Test: http/tests/misc/location-with-space.php

        * platform/network/cf/ResourceRequestCFNet.cpp:
        (WebCore::ResourceRequest::doUpdatePlatformRequest): Do update its URL, too.

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

LayoutTests/ChangeLog
LayoutTests/http/tests/misc/location-with-space-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/location-with-space.php [new file with mode: 0644]
LayoutTests/http/tests/misc/resources/a success.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/network/cf/ResourceRequestCFNet.cpp

index e2d6f17d1ffb929f7e57fffa83bc634b99b60caa..1a338435f1a74d8a4a79e23ed7a1dadee14901d7 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-06  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16701
+        <rdar://problem/5666580> REGRESSION: URL-encoded space (%20) in livejournal url
+        causes page load error
+
+        * http/tests/misc/location-with-space-expected.txt: Added.
+        * http/tests/misc/location-with-space.php: Added.
+        * http/tests/misc/resources/a success.html: Added.
+
 2008-01-06  Andrew Wellington  <proton@wiretapped.net>
 
         Reviewed by Darin.
diff --git a/LayoutTests/http/tests/misc/location-with-space-expected.txt b/LayoutTests/http/tests/misc/location-with-space-expected.txt
new file mode 100644 (file)
index 0000000..ff43ca4
--- /dev/null
@@ -0,0 +1 @@
+SUCCESS
diff --git a/LayoutTests/http/tests/misc/location-with-space.php b/LayoutTests/http/tests/misc/location-with-space.php
new file mode 100644 (file)
index 0000000..7ed6d65
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+  header('HTTP/1.0 302 Found');
+  header('Location: resources/a success.html');
+?>
diff --git a/LayoutTests/http/tests/misc/resources/a success.html b/LayoutTests/http/tests/misc/resources/a success.html
new file mode 100644 (file)
index 0000000..fe35df2
--- /dev/null
@@ -0,0 +1,5 @@
+<div>SUCCESS</div>
+<script>
+if (window.layoutTestController)
+  layoutTestController.dumpAsText();
+</script>
index 7fda0bfdcb8017684733c2bac058c7616fa8104c..348eeb0885b6f151b7b57e7d7929cd6efc65be03 100644 (file)
@@ -1,3 +1,16 @@
+2008-01-06  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16701
+        <rdar://problem/5666580> REGRESSION: URL-encoded space (%20) in livejournal url
+        causes page load error
+
+        Test: http/tests/misc/location-with-space.php
+
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::ResourceRequest::doUpdatePlatformRequest): Do update its URL, too.
+
 2008-01-06  Andrew Wellington  <proton@wiretapped.net>
 
         Reviewed by Darin.
index 1dfaf0d8bbc7ad859ea0540fe3626cebaf2880a0..b317f8e00cc274c9ab402db48e64ffde5380f5fe 100644 (file)
@@ -59,12 +59,13 @@ void ResourceRequest::doUpdatePlatformRequest()
 {
     CFMutableURLRequestRef cfRequest;
 
-    if (m_cfRequest) 
+    RetainPtr<CFURLRef> url(AdoptCF, ResourceRequest::url().createCFURL());
+    RetainPtr<CFURLRef> mainDocumentURL(AdoptCF, ResourceRequest::mainDocumentURL().createCFURL());
+    if (m_cfRequest) {
         cfRequest = CFURLRequestCreateMutableCopy(0, m_cfRequest.get());
-    else {
-        RetainPtr<CFURLRef> url(AdoptCF, ResourceRequest::url().createCFURL());
-        RetainPtr<CFURLRef> mainDocumentURL(AdoptCF, ResourceRequest::mainDocumentURL().createCFURL());
-
+        CFURLRequestSetURL(cfRequest, url.get());
+        CFURLRequestSetMainDocumentURL(cfRequest, mainDocumentURL.get());
+    } else {
         cfRequest = CFURLRequestCreateMutable(0, url.get(), (CFURLRequestCachePolicy)cachePolicy(), timeoutInterval(), mainDocumentURL.get());
     }