facade/flare-client-php

Facade\FlareClient\Http\Client get method query string Wrong stitching

fjp246810 opened this issue · 1 comments

in method makeRequest code

$queryString = http_build_query([
            'key' => $this->apiToken,
            'secret' => $this->apiSecret,
]);
$fullUrl = "{$this->baseUrl}/{$url}?{$queryString}";

$fullUrl already used ?

but in method makeCurlRequest code

case 'get':
                curl_setopt($curlHandle, CURLOPT_URL, $fullUrl.'?'.http_build_query($arguments));
                break;

Also used ? Symbol

The & symbol should be used

like this

case 'get':
                curl_setopt($curlHandle, CURLOPT_URL, $fullUrl.'&'.http_build_query($arguments));
                break;

This bug will cause the parameter to be truncated

like this

127.0.0.1 - - [24/Apr/2021:21:17:10 +0800] "GET /?key=fMMEfczZUzmTZLhe&secret=CJvpDkSKYbhtDYEv?p1=p1v&p2=p2v HTTP/1.0" 200 72 "-" "Laravel/Flare API 1.0"
/*************************************************************************/
array:3 [
"key" => "fMMEfczZUzmTZLhe"
"secret" => "CJvpDkSKYbhtDYEv?p1=p1v"
"p2" => "p2v"
]

Finally, thank you for your hard work and hope it will become better

Hi @fjp246810,

This should be fixed in 1.8.0