Permalink
Browse files

[Http] Using CURLOPT_INFILESIZE instead of Content-Length headers. Th…

…is prevents chunked transfer encoding when the Content-Length is known. Adding better test coverage.
  • Loading branch information...
1 parent 6bcd8a4 commit 7aa5084ddc34895f0f79ac78065a964da08e5d15 @mtdowling mtdowling committed Jan 25, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 Curl/CurlHandle.php
View
5 Curl/CurlHandle.php
@@ -112,9 +112,8 @@ public static function factory(RequestInterface $request)
break;
case 'PUT':
$curlOptions[CURLOPT_UPLOAD] = true;
- if (!$request->hasHeader('Content-Length')) {
- unset($headers['Content-Length']);
- } else {
+ unset($headers['Content-Length']);
+ if ($request->hasHeader('Content-Length')) {
$curlOptions[CURLOPT_INFILESIZE] = $request->getHeader('Content-Length');
}

0 comments on commit 7aa5084

Please sign in to comment.