Mobrovac has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/328497 )
Change subject: ApiRequest: Clone the request options before modifying them
......................................................................
ApiRequest: Clone the request options before modifying them
With the introduction of mwApiServer, ApiRequest.request started
modifying the request options object before issuing a request to the MW
API. However, the object itself is a property of its sub-classes, which
means that ApiRequest.request was modifying permanently the URI. Hence,
clone the request options object before modifying it.
Bug: T153797
Change-Id: Ibf4cf2fdab74d742c66aedc82379a57def91440a
---
M lib/mw/ApiRequest.js
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/97/328497/1
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js
index 2e709ac..5a667d2 100644
--- a/lib/mw/ApiRequest.js
+++ b/lib/mw/ApiRequest.js
@@ -272,10 +272,11 @@
var httpAgent = null;
var httpsAgent = null;
-ApiRequest.prototype.request = function(options, callback) {
+ApiRequest.prototype.request = function(requestOpts, callback) {
var env = this.env;
var proxy = this.proxy;
var mwApiServer = this.mwApiServer;
+ var options = Object.assign({}, requestOpts);
// this is a good place to put debugging statements
// if you want to watch network requests.
--
To view, visit https://gerrit.wikimedia.org/r/328497
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf4cf2fdab74d742c66aedc82379a57def91440a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Mobrovac <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits