Encode the API key when passed

This commit is contained in:
Samer Albahra
2019-01-10 13:35:00 -06:00
parent 5d7b5651a5
commit 3ec31ae6e3

View File

@@ -42,7 +42,7 @@ function resolveCoordinates( location, callback ) {
function getWeatherUndergroundData( location, weatherUndergroundKey, callback ) { function getWeatherUndergroundData( location, weatherUndergroundKey, callback ) {
// Generate URL using Weather Underground yesterday conditions // 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"; "/yesterday/conditions/astronomy/q/" + encodeURIComponent( location ) + ".json";
// Perform the HTTP request to retrieve the weather data // Perform the HTTP request to retrieve the weather data