Skip to content

Commit 6bde13a

Browse files
authored
Merge pull request #197 from open-runtimes/fix-empty-get-requests
Fix: empty body get requests
2 parents 9f15a25 + 37925cc commit 6bde13a

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)