Do not allow dot character in request extensions

This commit is contained in:
Petr Sloup 2016-03-09 17:24:49 +01:00
parent a495993e68
commit a0007b42f9

View file

@ -182,7 +182,7 @@ module.exports = function(maps, options, prefix) {
.replace('{z}', ':z(\\d+)') .replace('{z}', ':z(\\d+)')
.replace('{x}', ':x(\\d+)') .replace('{x}', ':x(\\d+)')
.replace('{y}', ':y(\\d+)') .replace('{y}', ':y(\\d+)')
.replace('{format}', ':format([\\w\\.]+)'); .replace('{format}', ':format([\\w]+)');
var respondImage = function(z, lon, lat, width, height, scale, format, res, next) { var respondImage = function(z, lon, lat, width, height, scale, format, res, next) {
if (Math.abs(lon) > 180 || Math.abs(lat) > 85.06) { if (Math.abs(lon) > 180 || Math.abs(lat) > 85.06) {
@ -267,7 +267,7 @@ module.exports = function(maps, options, prefix) {
}); });
var staticPattern = var staticPattern =
'/static/%s:scale(' + SCALE_PATTERN + ')?\.:format([\\w\\.]+)'; '/static/%s:scale(' + SCALE_PATTERN + ')?\.:format([\\w]+)';
var centerPattern = var centerPattern =
util.format(':lon(%s),:lat(%s),:z(\\d+)/:width(\\d+)x:height(\\d+)', util.format(':lon(%s),:lat(%s),:z(\\d+)/:width(\\d+)x:height(\\d+)',