From 110820face184d07212f50cb5359df90da90ab91 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 19 Aug 2016 15:39:58 +0100 Subject: [PATCH] use url.resolve to build url for freegeoip lookups --- services/web/app/coffee/infrastructure/GeoIpLookup.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee index 5b64b8e6f4..88f3ed4bfa 100644 --- a/services/web/app/coffee/infrastructure/GeoIpLookup.coffee +++ b/services/web/app/coffee/infrastructure/GeoIpLookup.coffee @@ -2,6 +2,7 @@ request = require("request") settings = require("settings-sharelatex") _ = require("underscore") logger = require("logger-sharelatex") +URL = require("url") currencyMappings = { "GB":"GBP" @@ -31,7 +32,7 @@ module.exports = GeoIpLookup = return callback(e) ip = ip.trim().split(" ")[0] opts = - url: "#{settings.apis.geoIpLookup.url}/#{ip}" + url: URL.resolve(settings.apis.geoIpLookup.url,ip) timeout: 1000 json:true logger.log ip:ip, opts:opts, "getting geo ip details"