codeql
This commit is contained in:
parent
c2f95ab2d7
commit
3def0d2c45
2 changed files with 11 additions and 9 deletions
|
@ -50,8 +50,8 @@ export async function serve_font(options, allowedFonts, programOpts) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
console.log(
|
console.log(
|
||||||
`Handling font request for: /fonts/%s/%s.pbf`,
|
`Handling font request for: /fonts/%s/%s.pbf`,
|
||||||
sanitizedFontStack,
|
sanitizedFontStack.replace(/\n|\r/g, ''),
|
||||||
sanitizedRange,
|
sanitizedRange.replace(/\n|\r/g, ''),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ export async function serve_font(options, allowedFonts, programOpts) {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(
|
console.error(
|
||||||
`Error serving font: %s/%s.pbf, Error: %s`,
|
`Error serving font: %s/%s.pbf, Error: %s`,
|
||||||
fontstack,
|
sanitizedFontStack.replace(/\n|\r/g, ''),
|
||||||
sanitizedRange,
|
sanitizedRange.replace(/\n|\r/g, ''),
|
||||||
String(err),
|
String(err),
|
||||||
);
|
);
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -56,7 +56,7 @@ export const serve_style = {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
console.log(
|
console.log(
|
||||||
'Handling style request for: /styles/%s/style.json',
|
'Handling style request for: /styles/%s/style.json',
|
||||||
String(id),
|
String(id).replace(/\n|\r/g, ''),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -103,10 +103,12 @@ export const serve_style = {
|
||||||
*/
|
*/
|
||||||
app.get(`/:id/sprite{/:spriteID}{@:scale}{.:format}`, (req, res, next) => {
|
app.get(`/:id/sprite{/:spriteID}{@:scale}{.:format}`, (req, res, next) => {
|
||||||
const { spriteID = 'default', id, format, scale } = req.params;
|
const { spriteID = 'default', id, format, scale } = req.params;
|
||||||
const sanitizedId = String(id);
|
const sanitizedId = String(id).replace(/\n|\r/g, '');
|
||||||
const sanitizedScale = scale ? String(scale) : '';
|
const sanitizedScale = scale ? String(scale).replace(/\n|\r/g, '') : '';
|
||||||
const sanitizedSpriteID = String(spriteID);
|
const sanitizedSpriteID = String(spriteID).replace(/\n|\r/g, '');
|
||||||
const sanitizedFormat = format ? '.' + String(format) : '';
|
const sanitizedFormat = format
|
||||||
|
? '.' + String(format).replace(/\n|\r/g, '')
|
||||||
|
: '';
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
console.log(
|
console.log(
|
||||||
`Handling sprite request for: /styles/%s/sprite/%s%s%s`,
|
`Handling sprite request for: /styles/%s/sprite/%s%s%s`,
|
||||||
|
|
Loading…
Reference in a new issue