Skip to content
Snippets Groups Projects
Unverified Commit d32b0c38 authored by DaveD's avatar DaveD Committed by GitHub
Browse files

Merge pull request #21096 from mattwire/guzzletimeout

Respect http_timeout core setting for Guzzle HTTP requests
parents 7379b910 0b181297
Branches
Tags
No related merge requests found
......@@ -74,6 +74,7 @@ class CRM_Utils_Address_USPS {
'API' => 'Verify',
'XML' => $XMLQuery,
],
'timeout' => \Civi::settings()->get('http_timeout'),
]);
$session = CRM_Core_Session::singleton();
......
......@@ -106,7 +106,7 @@ class CRM_Utils_Geocode_Google {
$query = 'https://' . self::$_server . self::$_uri . $add;
$client = new GuzzleHttp\Client();
$request = $client->request('GET', $query);
$request = $client->request('GET', $query, ['timeout' => \Civi::settings()->get('http_timeout')]);
$string = $request->getBody();
libxml_use_internal_errors(TRUE);
......
......@@ -67,7 +67,7 @@ function _recaptcha_qsencode ($data) {
function _recaptcha_http_post($host, $path, $data) {
$client = new Client();
try {
$response = $client->request('POST', $host . '/' . $path, ['query' => $data]);
$response = $client->request('POST', $host . '/' . $path, ['query' => $data, 'timeout' => \Civi::settings()->get('http_timeout')]);
}
catch (Exception $e) {
return '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment