Skip to content

Commit

Permalink
Merge pull request #32 from sunrise-php/release/v1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Jan 9, 2022
2 parents 52dda1d + c63e743 commit b2c4c41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"scripts": {
"test": [
"phpcs",
"XDEBUG_MODE=coverage phpunit --coverage-text"
"XDEBUG_MODE=coverage phpunit --coverage-text --colors=always"
],
"build": [
"phpdoc -d src/ -t phpdoc/",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<phpunit colors="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
Expand Down
6 changes: 5 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use function curl_multi_close;
use function curl_setopt_array;
use function explode;
use function in_array;
use function sprintf;
use function strpos;
use function substr;
Expand Down Expand Up @@ -168,7 +169,10 @@ private function createCurlHandleFromRequest(RequestInterface $request)

$curlOptions[CURLOPT_CUSTOMREQUEST] = $request->getMethod();
$curlOptions[CURLOPT_URL] = (string) $request->getUri();
$curlOptions[CURLOPT_POSTFIELDS] = (string) $request->getBody();

if (!in_array($request->getMethod(), ['GET', 'HEAD'], true)) {
$curlOptions[CURLOPT_POSTFIELDS] = (string) $request->getBody();
}

foreach ($request->getHeaders() as $name => $values) {
foreach ($values as $value) {
Expand Down

0 comments on commit b2c4c41

Please sign in to comment.