Skip to content

Commit b2c4c41

Browse files
authored
Merge pull request #32 from sunrise-php/release/v1.4.3
2 parents 52dda1d + c63e743 commit b2c4c41

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"scripts": {
5353
"test": [
5454
"phpcs",
55-
"XDEBUG_MODE=coverage phpunit --coverage-text"
55+
"XDEBUG_MODE=coverage phpunit --coverage-text --colors=always"
5656
],
5757
"build": [
5858
"phpdoc -d src/ -t phpdoc/",

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<phpunit colors="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
33
<coverage>
44
<include>
55
<directory>./src</directory>

src/Client.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use function curl_multi_close;
3838
use function curl_setopt_array;
3939
use function explode;
40+
use function in_array;
4041
use function sprintf;
4142
use function strpos;
4243
use function substr;
@@ -168,7 +169,10 @@ private function createCurlHandleFromRequest(RequestInterface $request)
168169

169170
$curlOptions[CURLOPT_CUSTOMREQUEST] = $request->getMethod();
170171
$curlOptions[CURLOPT_URL] = (string) $request->getUri();
171-
$curlOptions[CURLOPT_POSTFIELDS] = (string) $request->getBody();
172+
173+
if (!in_array($request->getMethod(), ['GET', 'HEAD'], true)) {
174+
$curlOptions[CURLOPT_POSTFIELDS] = (string) $request->getBody();
175+
}
172176

173177
foreach ($request->getHeaders() as $name => $values) {
174178
foreach ($values as $value) {

0 commit comments

Comments
 (0)