From c73881f3fe89d73b05f8f3da6272e4f91c408d2c Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Jun 2015 12:22:23 +0100 Subject: [PATCH] Use utils.keys rather than Object.keys for older browsers. --- lib/http-api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/http-api.js b/lib/http-api.js index f973252d3..2c04c1bd6 100644 --- a/lib/http-api.js +++ b/lib/http-api.js @@ -80,7 +80,7 @@ module.exports.MatrixHttpApi.prototype = { if (resizeMethod) { params.method = resizeMethod; } - if (Object.keys(params).length > 0) { + if (utils.keys(params).length > 0) { // these are thumbnailing params so they probably want the // thumbnailing API... prefix = "/_matrix/media/v1/thumbnail/"; @@ -93,7 +93,7 @@ module.exports.MatrixHttpApi.prototype = { serverAndMediaId = serverAndMediaId.substr(0, fragmentOffset); } return this.credentials.baseUrl + prefix + serverAndMediaId + - (Object.keys(params).length === 0 ? "" : + (utils.keys(params).length === 0 ? "" : ("?" + utils.encodeParams(params))) + fragment; }, @@ -119,7 +119,7 @@ module.exports.MatrixHttpApi.prototype = { $ident: identiconString }); return this.credentials.baseUrl + path + - (Object.keys(params).length === 0 ? "" : + (utils.keys(params).length === 0 ? "" : ("?" + utils.encodeParams(params))); },