mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Set User-Agent in server-side VRS requests to RESTBase/Parsoid
Bug: T131171 Change-Id: I385ef1f3efb674c4ad3ffb334c0ff5b830f89a37
This commit is contained in:
parent
d4d1f10b95
commit
1c455a5fb8
|
@ -86,6 +86,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
}
|
||||
|
||||
private function requestRestbase( $method, $path, $params, $reqheaders = [] ) {
|
||||
global $wgVersion;
|
||||
$request = [
|
||||
'method' => $method,
|
||||
'url' => '/restbase/local/v1/' . $path
|
||||
|
@ -97,6 +98,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
}
|
||||
// Should be synchronised with modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js
|
||||
$reqheaders['Accept'] = 'text/html; charset=utf-8; profile="mediawiki.org/specs/html/1.2.0"';
|
||||
$reqheaders['User-Agent'] = 'VisualEditor-MediaWiki/' . $wgVersion;
|
||||
$request['headers'] = $reqheaders;
|
||||
$response = $this->serviceClient->run( $request );
|
||||
if ( $response['code'] === 200 && $response['error'] === "" ) {
|
||||
|
|
Loading…
Reference in a new issue