Skip to content
Snippets Groups Projects

Issue #3445088: Call to undefined method GuzzleHttp\Utils::defaultUserAgent()

Open Ruud Simons requested to merge issue/salesforce-3445088:3445088-call-to-undefined into 5.0.x
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -22,6 +22,8 @@ class TestHttpClientFactory extends ClientFactory {
* The HTTP client.
*/
public function fromOptions(array $config = []) {
$default_user_agent = method_exists('GuzzleHttp\Utils' , 'defaultUserAgent') ? Utils::defaultUserAgent() : \GuzzleHttp\default_user_agent();
$default_config = [
// Security consideration: we must not use the certificate authority
// file shipped with Guzzle because it can easily get outdated if a
@@ -32,7 +34,7 @@ class TestHttpClientFactory extends ClientFactory {
'verify' => TRUE,
'timeout' => 30,
'headers' => [
'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . Utils::defaultUserAgent(),
'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . $default_user_agent,
],
'handler' => $this->stack,
// Security consideration: prevent Guzzle from using environment variables
Loading