Minor fix in style path handling (allow absolute paths)

This commit is contained in:
Petr Sloup 2017-04-07 18:53:11 +02:00
parent f6580c0342
commit 8ea665297f
2 changed files with 2 additions and 2 deletions

View file

@ -166,7 +166,7 @@ module.exports = function(options, repo, params, id, dataResolver) {
});
};
var styleJSONPath = path.join(options.paths.styles, styleFile);
var styleJSONPath = path.resolve(options.paths.styles, styleFile);
styleJSON = clone(require(styleJSONPath));
var httpTester = /^(http(s)?:)?\/\//;

View file

@ -10,7 +10,7 @@ var clone = require('clone'),
module.exports = function(options, repo, params, id, reportTiles, reportFont) {
var app = express().disable('x-powered-by');
var styleFile = path.join(options.paths.styles, params.style);
var styleFile = path.resolve(options.paths.styles, params.style);
var styleJSON = clone(require(styleFile));
Object.keys(styleJSON.sources).forEach(function(name) {