Merge pull request #9551 from Benni0/2.4

fix: CurlClient doesn't use correct Proxy settings
pull/9553/head
Alexandre Dulaunoy 2024-02-07 10:51:26 +01:00 committed by GitHub
commit 90126dc1dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 6 deletions

View File

@ -30,9 +30,6 @@ class CurlClient extends HttpSocketExtended
/** @var array */
private $proxy = [];
/** @var array */
private $defaultOptions;
/**
* @param array $params
* @noinspection PhpMissingParentConstructorInspection
@ -60,7 +57,6 @@ class CurlClient extends HttpSocketExtended
if (isset($params['ssl_verify_peer'])) {
$this->verifyPeer = $params['ssl_verify_peer'];
}
$this->defaultOptions = $this->generateDefaultOptions();
}
/**
@ -198,7 +194,7 @@ class CurlClient extends HttpSocketExtended
$url .= '?' . http_build_query($query, '', '&', PHP_QUERY_RFC3986);
}
$options = $this->defaultOptions;
$options = $this->generateOptions();
$options[CURLOPT_URL] = $url;
$options[CURLOPT_CUSTOMREQUEST] = $method;
@ -312,7 +308,7 @@ class CurlClient extends HttpSocketExtended
/**
* @return array
*/
private function generateDefaultOptions()
private function generateOptions()
{
$options = [
CURLOPT_FOLLOWLOCATION => true, // Allows to follow redirect