From 3ec31ae6e30150740847144a87dfee21cf28914c Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Thu, 10 Jan 2019 13:35:00 -0600 Subject: [PATCH] Encode the API key when passed --- routes/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/weather.js b/routes/weather.js index 6207aaa..b38a7d5 100755 --- a/routes/weather.js +++ b/routes/weather.js @@ -42,7 +42,7 @@ function resolveCoordinates( location, callback ) { function getWeatherUndergroundData( location, weatherUndergroundKey, callback ) { // Generate URL using Weather Underground yesterday conditions - var url = "http://api.wunderground.com/api/" + weatherUndergroundKey + + var url = "http://api.wunderground.com/api/" + encodeURIComponent( weatherUndergroundKey ) + "/yesterday/conditions/astronomy/q/" + encodeURIComponent( location ) + ".json"; // Perform the HTTP request to retrieve the weather data