Commit 75674998 authored by catch's avatar catch
Browse files

task: #3638086 GuzzleHttp\Utils::defaultUserAgent() is deprecated Since guzzlehttp/guzzle 8.5

By: godotislate
(cherry picked from commit e95c24bb)
parent 9d516d4f
Loading
Loading
Loading
Loading
Loading
+2 −2
Changes for core/lib/Drupal/Core/Http/ClientFactory.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Site\Settings;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Utils;

/**
 * Helper class to construct a HTTP client with Drupal specific config.
@@ -50,7 +50,7 @@ public function fromOptions(array $config = []) {
      'verify' => TRUE,
      'timeout' => 30,
      'headers' => [
        'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . Utils::defaultUserAgent(),
        'User-Agent' => sprintf('Drupal/%s (+https://www.drupal.org/) GuzzleHttp/%d', \Drupal::VERSION, ClientInterface::MAJOR_VERSION),
      ],
      'handler' => $this->stack,
      // Security consideration: prevent Guzzle from using environment variables