Skip to content

Commit

Permalink
CurlTransport::prepare() fixed to add 'no body' option for empty co…
Browse files Browse the repository at this point in the history
…ntent on GET, HEAD or OPTIONS
  • Loading branch information
klimov-paul committed Jun 7, 2016
1 parent 6b4928d commit f17ba97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CurlTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ private function prepare($request)
}

$content = $request->getContent();
if ($content !== null) {
if ($content === null) {
if (in_array($method, ['GET', 'HEAD', 'OPTIONS'])) {
$curlOptions[CURLOPT_NOBODY] = true;
}
} else {
$curlOptions[CURLOPT_POSTFIELDS] = $content;
}

Expand Down

0 comments on commit f17ba97

Please sign in to comment.