From 4992bc41941497578d13eb10d3939274722d6bad Mon Sep 17 00:00:00 2001 From: Petr Sloup Date: Mon, 23 Jan 2017 12:58:47 +0100 Subject: [PATCH] Fix url instrumentation when serving style to be more robust (close #108) --- src/serve_style.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/serve_style.js b/src/serve_style.js index cf0bc86..47ca46b 100644 --- a/src/serve_style.js +++ b/src/serve_style.js @@ -60,6 +60,9 @@ module.exports = function(options, repo, params, id, reportTiles, reportFont) { app.get('/' + id + '.json', function(req, res, next) { var fixUrl = function(url, opt_nokey, opt_nostyle) { + if (!url || (typeof url !== 'string') || url.indexOf('local://' !== 0)) { + return url; + } var queryParams = []; if (!opt_nostyle) { queryParams.push('style=' + id);