Merge pull request #463 from korpd/fix-xss-parameter-style

Fix reflected XSS in 'style' parameter
This commit is contained in:
Petr Sloup 2020-07-02 14:47:24 +02:00 committed by GitHub
commit 042b8b986a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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('&')}`) : '';