Title: [98198] trunk/Source/WebCore
Revision
98198
Author
[email protected]
Date
2011-10-22 22:03:19 -0700 (Sat, 22 Oct 2011)

Log Message

HTTPBodyStream in NSURLRequest gets lost when using CFNetwork loader
https://bugs.webkit.org/show_bug.cgi?id=70583
<rdar://problem/10281227>

Reviewed by Darin Adler.

Call WebCore::setHTTPBody() only if we actually have a FormData. Unconditionally calling it
results in us passing 0 to wkCFURLRequestSetHTTPRequestBodyParts() which resets any input
stream specified by the user on the NSURLRequest. This code matches the behavior in the
Foundation version of doUpdatePlatformRequest().

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98197 => 98198)


--- trunk/Source/WebCore/ChangeLog	2011-10-23 00:40:00 UTC (rev 98197)
+++ trunk/Source/WebCore/ChangeLog	2011-10-23 05:03:19 UTC (rev 98198)
@@ -1,3 +1,19 @@
+2011-10-22  Pratik Solanki  <[email protected]>
+
+        HTTPBodyStream in NSURLRequest gets lost when using CFNetwork loader
+        https://bugs.webkit.org/show_bug.cgi?id=70583
+        <rdar://problem/10281227>
+
+        Reviewed by Darin Adler.
+
+        Call WebCore::setHTTPBody() only if we actually have a FormData. Unconditionally calling it
+        results in us passing 0 to wkCFURLRequestSetHTTPRequestBodyParts() which resets any input
+        stream specified by the user on the NSURLRequest. This code matches the behavior in the
+        Foundation version of doUpdatePlatformRequest().
+
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::ResourceRequest::doUpdatePlatformRequest):
+
 2011-10-22  Adam Bergkvist  <[email protected]>
 
         Move all MediaStream and PeerConnection related non-platform files to WebCore/mediastream

Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp (98197 => 98198)


--- trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2011-10-23 00:40:00 UTC (rev 98197)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2011-10-23 05:03:19 UTC (rev 98198)
@@ -153,7 +153,9 @@
         wkSetHTTPPipeliningPriority(cfRequest, toHTTPPipeliningPriority(m_priority));
 
     setHeaderFields(cfRequest, httpHeaderFields());
-    WebCore::setHTTPBody(cfRequest, httpBody());
+    RefPtr<FormData> formData = httpBody();
+    if (formData && !formData->isEmpty())
+        WebCore::setHTTPBody(cfRequest, formData);
     CFURLRequestSetShouldHandleHTTPCookies(cfRequest, allowCookies());
 
     unsigned fallbackCount = m_responseContentDispositionEncodingFallbackArray.size();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to