diff --git a/src/Google/Config.php b/src/Google/Config.php index d582d8316..2f52405cf 100644 --- a/src/Google/Config.php +++ b/src/Google/Config.php @@ -58,6 +58,10 @@ public function __construct($ini_file_location = null) 'Google_IO_Abstract' => array( 'request_timeout_seconds' => 100, ), + 'Google_IO_Curl' => array( + 'disable_proxy_workaround' => false, + 'options' => null, + ), 'Google_Logger_Abstract' => array( 'level' => 'debug', 'log_format' => "[%datetime%] %level%: %message% %context%\n", diff --git a/src/Google/IO/Curl.php b/src/Google/IO/Curl.php index c250ec9d9..b0e8adb66 100644 --- a/src/Google/IO/Curl.php +++ b/src/Google/IO/Curl.php @@ -32,6 +32,9 @@ class Google_IO_Curl extends Google_IO_Abstract private $options = array(); + /** @var bool $disableProxyWorkaround */ + private $disableProxyWorkaround; + public function __construct(Google_Client $client) { if (!extension_loaded('curl')) { @@ -41,6 +44,11 @@ public function __construct(Google_Client $client) } parent::__construct($client); + + $this->disableProxyWorkaround = $this->client->getClassConfig( + 'Google_IO_Curl', + 'disable_proxy_workaround' + ); } /** @@ -175,6 +183,10 @@ public function getTimeout() */ protected function needsQuirk() { + if ($this->disableProxyWorkaround) { + return false; + } + $ver = curl_version(); $versionNum = $ver['version_number']; return $versionNum < Google_IO_Curl::NO_QUIRK_VERSION;