From db5cb74486fdc9d5e9827791097a301bb444b096 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Fri, 22 Oct 2021 10:59:49 -0700 Subject: Upgrade to Shellbox 3.0.0 Depends-On: Idfe35c788a84f04a760edb01c0bf48ddc8accb1f Change-Id: Ib5ffeec5bb6b45ea7fb93aec8df4368231188b67 --- includes/shell/ShellboxClientFactory.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'includes/shell/ShellboxClientFactory.php') diff --git a/includes/shell/ShellboxClientFactory.php b/includes/shell/ShellboxClientFactory.php index 81fc0a8cdbfe..1ce19c9285e9 100644 --- a/includes/shell/ShellboxClientFactory.php +++ b/includes/shell/ShellboxClientFactory.php @@ -3,8 +3,10 @@ namespace MediaWiki\Shell; use GuzzleHttp\Psr7\Uri; +use GuzzleHttp\RequestOptions; use MediaWiki\Http\HttpRequestFactory; use Shellbox\Client; +use WebRequest; /** * This is a service which provides a configured client to access a remote @@ -64,8 +66,13 @@ class ShellboxClientFactory { } return new Client( - new ShellboxHttpClient( $this->requestFactory, - $options['timeout'] ?? self::DEFAULT_TIMEOUT ), + $this->requestFactory->createGuzzleClient( [ + RequestOptions::TIMEOUT => $options['timeout'] ?? self::DEFAULT_TIMEOUT, + RequestOptions::HEADERS => [ + 'X-Request-Id' => WebRequest::getRequestId(), + ], + RequestOptions::HTTP_ERRORS => false, + ] ), new Uri( $url ), $this->key ); -- cgit v1.2.3