aboutsummaryrefslogtreecommitdiffstats
path: root/includes/shell/ShellboxClientFactory.php
diff options
context:
space:
mode:
authorPetr Pchelko <ppchelko@wikimedia.org>2021-10-22 10:59:49 -0700
committerPetr Pchelko <ppchelko@wikimedia.org>2021-11-05 08:31:26 -0700
commitdb5cb74486fdc9d5e9827791097a301bb444b096 (patch)
tree3c099c1ce3ba8b9cd05d544d79293e7843a0793a /includes/shell/ShellboxClientFactory.php
parentffb80447cf08c138a2f5793c9b81d2d4e51519e7 (diff)
downloadmediawikicore-db5cb74486fdc9d5e9827791097a301bb444b096.tar.gz
mediawikicore-db5cb74486fdc9d5e9827791097a301bb444b096.zip
Upgrade to Shellbox 3.0.0
Depends-On: Idfe35c788a84f04a760edb01c0bf48ddc8accb1f Change-Id: Ib5ffeec5bb6b45ea7fb93aec8df4368231188b67
Diffstat (limited to 'includes/shell/ShellboxClientFactory.php')
-rw-r--r--includes/shell/ShellboxClientFactory.php11
1 files changed, 9 insertions, 2 deletions
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
);