Fix reflected XSS in 'style' parameter

This commit is contained in:
Daniel Korp 2020-07-02 10:28:25 +02:00
parent f8563e1f2b
commit 038bfe29d6
No known key found for this signature in database
GPG key ID: 1FA328D343D7DEA0

View file

@ -43,7 +43,7 @@ module.exports.getTileUrls = (req, domains, path, format, publicUrl, aliases) =>
queryParams.push(`key=${encodeURIComponent(req.query.key)}`); queryParams.push(`key=${encodeURIComponent(req.query.key)}`);
} }
if (req.query.style) { if (req.query.style) {
queryParams.push(`style=${req.query.style}`); queryParams.push(`style=${encodeURIComponent(req.query.style)}`);
} }
const query = queryParams.length > 0 ? (`?${queryParams.join('&')}`) : ''; const query = queryParams.length > 0 ? (`?${queryParams.join('&')}`) : '';