Skip to content

Commit 36cd92d

Browse files
mremirobocoder
authored andcommitted
fix(curl): suppress "Transfer-Encoding: chunked" added by last version of curl (#96)
1 parent a1112fb commit 36cd92d

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
@@ -69,6 +69,10 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
6969
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
7070
} else {
7171
$customHeaders[] = 'Content-Length: 0';
72+
73+
// Suppress "Transfer-Encoding: chunked" header automatically added by cURL that
74+
// causes a 400 bad request (bad content-length).
75+
$customHeaders[] = 'Transfer-Encoding:';
7276
}
7377

7478
// Suppress "Expect: 100-continue" header automatically added by cURL that
@@ -87,6 +91,10 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
8791
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
8892
} else {
8993
$customHeaders[] = 'Content-Length: 0';
94+
95+
// Suppress "Transfer-Encoding: chunked" header automatically added by cURL that
96+
// causes a 400 bad request (bad content-length).
97+
$customHeaders[] = 'Transfer-Encoding:';
9098
}
9199

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

0 commit comments

Comments
 (0)