diff --git a/src/http-api.js b/src/http-api.js index 94a0dcd81..8b19e1e25 100644 --- a/src/http-api.js +++ b/src/http-api.js @@ -651,12 +651,10 @@ MatrixHttpApi.prototype = { const self = this; if (this.opts.extraParams) { - for (const key in this.opts.extraParams) { - if (!this.opts.extraParams.hasOwnProperty(key)) { - continue; - } - queryParams[key] = this.opts.extraParams[key]; - } + queryParams = { + ...queryParams, + ...this.opts.extraParams, + }; } const headers = utils.extend({}, opts.headers || {});