From d3521826ae660bbb438a4182aabfbaaac57273f2 Mon Sep 17 00:00:00 2001
From: echicken <>
Date: Fri, 16 Aug 2019 15:00:12 +0000
Subject: [PATCH] 'mode' param can be omitted in call_api unless you don't want
 json.

---
 exec/load/openweathermap.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/exec/load/openweathermap.js b/exec/load/openweathermap.js
index e83ac30261..58107a9079 100644
--- a/exec/load/openweathermap.js
+++ b/exec/load/openweathermap.js
@@ -72,6 +72,7 @@ OpenWeatherMap.prototype.call_api = function (endpoint, params, raw) {
     if (!this.rate_limit()) return { error: 'Rate limit exceeded' };
 
     var url = 'http://api.openweathermap.org/data/2.5/' + endpoint;
+    if (params.mode === undefined) params.mode = 'json';
     url += Object.keys(params).reduce(function (a, c, i) {
         return a + (i == 0 ? '?' : '&') + c + '=' + params[c];
     }, '');
-- 
GitLab