1
0
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:
Michael Dowling 2013-02-23 17:33:43 -08:00
parent 66d7d581da
commit d697838875
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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