mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-25 18:43:22 +01:00
Using replace rather than merge when parsing curl option settings
This commit is contained in:
parent
66d7d581da
commit
d697838875
@ -441,7 +441,7 @@ class Client extends AbstractHasDispatcher implements ClientInterface
|
||||
|
||||
// Add any curl options to the request
|
||||
if ($options = $this->config->get(self::CURL_OPTIONS)) {
|
||||
$request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($options));
|
||||
$request->getCurlOptions()->replace(CurlHandle::parseCurlConfig($options));
|
||||
}
|
||||
|
||||
// Add request parameters to the request
|
||||
|
@ -458,7 +458,10 @@ class CurlHandle
|
||||
// Convert constants represented as string to constant int values
|
||||
$key = constant($key);
|
||||
}
|
||||
$curlOptions[$key] = is_string($value) && defined($value) ? constant($value) : $value;
|
||||
if (is_string($value) && defined($value)) {
|
||||
$value = constant($value);
|
||||
}
|
||||
$curlOptions[$key] = $value;
|
||||
}
|
||||
|
||||
return $curlOptions;
|
||||
|
@ -282,7 +282,7 @@ abstract class AbstractCommand extends Collection implements CommandInterface
|
||||
|
||||
// Add any curl options to the request
|
||||
if ($options = $this->get(Client::CURL_OPTIONS)) {
|
||||
$this->request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($options));
|
||||
$this->request->getCurlOptions()->replace(CurlHandle::parseCurlConfig($options));
|
||||
}
|
||||
|
||||
// Set a custom response body
|
||||
|
Loading…
x
Reference in New Issue
Block a user