jenkins-bot has submitted this change and it was merged.
Change subject: Set User-Agent in server-side VRS requests to RESTBase/Parsoid
......................................................................
Set User-Agent in server-side VRS requests to RESTBase/Parsoid
Bug: T131171
Change-Id: I385ef1f3efb674c4ad3ffb334c0ff5b830f89a37
---
M ApiVisualEditor.php
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, but someone else must approve
Jforrester: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index b49108d..494e2f1 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -86,6 +86,7 @@
}
private function requestRestbase( $method, $path, $params, $reqheaders
= [] ) {
+ global $wgVersion;
$request = [
'method' => $method,
'url' => '/restbase/local/v1/' . $path
@@ -97,6 +98,7 @@
}
// 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'] === "" ) {
--
To view, visit https://gerrit.wikimedia.org/r/280360
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I385ef1f3efb674c4ad3ffb334c0ff5b830f89a37
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits