Title: [227465] trunk/Source/WebCore
Revision
227465
Author
[email protected]
Date
2018-01-23 17:08:29 -0800 (Tue, 23 Jan 2018)

Log Message

[Curl] Fix wrong redirection with relative url when it happens from
different host than original host.
https://bugs.webkit.org/show_bug.cgi?id=181873

Patch by Basuke Suzuki <[email protected]> on 2018-01-23
Reviewed by Alex Christensen.

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::willSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::willSendRequest):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (227464 => 227465)


--- trunk/Source/WebCore/ChangeLog	2018-01-24 01:07:31 UTC (rev 227464)
+++ trunk/Source/WebCore/ChangeLog	2018-01-24 01:08:29 UTC (rev 227465)
@@ -1,3 +1,16 @@
+2018-01-23  Basuke Suzuki  <[email protected]>
+
+        [Curl] Fix wrong redirection with relative url when it happens from
+        different host than original host.
+        https://bugs.webkit.org/show_bug.cgi?id=181873
+
+        Reviewed by Alex Christensen.
+
+        * platform/network/curl/CurlDownload.cpp:
+        (WebCore::CurlDownload::willSendRequest):
+        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
+        (WebCore::ResourceHandleCurlDelegate::willSendRequest):
+
 2018-01-23  Eric Carlson  <[email protected]>
 
         Resign NowPlaying status when no media element is eligible

Modified: trunk/Source/WebCore/platform/network/curl/CurlDownload.cpp (227464 => 227465)


--- trunk/Source/WebCore/platform/network/curl/CurlDownload.cpp	2018-01-24 01:07:31 UTC (rev 227464)
+++ trunk/Source/WebCore/platform/network/curl/CurlDownload.cpp	2018-01-24 01:08:29 UTC (rev 227465)
@@ -174,7 +174,7 @@
     }
 
     String location = m_response.httpHeaderField(HTTPHeaderName::Location);
-    URL newURL = URL(m_request.url(), location);
+    URL newURL = URL(m_response.url(), location);
     bool crossOrigin = !protocolHostAndPortAreEqual(m_request.url(), newURL);
 
     ResourceRequest newRequest = m_request;

Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.cpp (227464 => 227465)


--- trunk/Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.cpp	2018-01-24 01:07:31 UTC (rev 227464)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.cpp	2018-01-24 01:08:29 UTC (rev 227465)
@@ -322,7 +322,7 @@
     }
 
     String location = response().httpHeaderField(HTTPHeaderName::Location);
-    URL newURL = URL(m_firstRequest.url(), location);
+    URL newURL = URL(m_handle->getInternal()->m_response.url(), location);
     bool crossOrigin = !protocolHostAndPortAreEqual(m_firstRequest.url(), newURL);
 
     ResourceRequest newRequest = m_firstRequest;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to