Skip to content

Commit 7fd1dbb

Browse files
mremirobocoder
authored andcommitted
fix(curl): suppress "Transfer-Encoding: chunked" added by last version of curl (#96)
1 parent 6fa9594 commit 7fd1dbb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/WebDriver/Service/CurlService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
5454
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
5555
} else {
5656
$customHeaders[] = 'Content-Length: 0';
57+
58+
// Suppress "Transfer-Encoding: chunked" header automatically added by cURL that
59+
// causes a 400 bad request (bad content-length).
60+
$customHeaders[] = 'Transfer-Encoding:';
5761
}
5862

5963
// Suppress "Expect: 100-continue" header automatically added by cURL that
@@ -72,6 +76,10 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
7276
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
7377
} else {
7478
$customHeaders[] = 'Content-Length: 0';
79+
80+
// Suppress "Transfer-Encoding: chunked" header automatically added by cURL that
81+
// causes a 400 bad request (bad content-length).
82+
$customHeaders[] = 'Transfer-Encoding:';
7583
}
7684

7785
// Suppress "Expect: 100-continue" header automatically added by cURL that

0 commit comments

Comments
 (0)