Skip to content

Commit ee643b9

Browse files
committed
Fix empty body get requests
1 parent 9f15a25 commit ee643b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Executor/Runner/Docker.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,11 @@ public function createExecution(
960960
\curl_setopt($ch, CURLOPT_URL, "http://" . $hostname . ":3000" . $path);
961961
\curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
962962
\curl_setopt($ch, CURLOPT_NOBODY, \strtoupper($method) === 'HEAD');
963-
\curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
963+
964+
if(!empty($payload)) {
965+
\curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
966+
}
967+
964968
\curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
965969
\curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$responseHeaders) {
966970
$len = strlen($header);

0 commit comments

Comments
 (0)