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) {
|
||||
console.log(
|
||||
`Handling font request for: /fonts/%s/%s.pbf`,
|
||||
sanitizedFontStack,
|
||||
sanitizedRange,
|
||||
sanitizedFontStack.replace(/\n|\r/g, ''),
|
||||
sanitizedRange.replace(/\n|\r/g, ''),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -80,8 +80,8 @@ export async function serve_font(options, allowedFonts, programOpts) {
|
|||
} catch (err) {
|
||||
console.error(
|
||||
`Error serving font: %s/%s.pbf, Error: %s`,
|
||||
fontstack,
|
||||
sanitizedRange,
|
||||
sanitizedFontStack.replace(/\n|\r/g, ''),
|
||||
sanitizedRange.replace(/\n|\r/g, ''),
|
||||
String(err),
|
||||
);
|
||||
return res
|
||||
|
|
|
@ -56,7 +56,7 @@ export const serve_style = {
|
|||
if (verbose) {
|
||||
console.log(
|
||||
'Handling style request for: /styles/%s/style.json',
|
||||
String(id),
|
||||
String(id).replace(/\n|\r/g, ''),
|
||||
);
|
||||
}
|
||||
try {
|
||||
|
@ -103,10 +103,12 @@ export const serve_style = {
|
|||
*/
|
||||
app.get(`/:id/sprite{/:spriteID}{@:scale}{.:format}`, (req, res, next) => {
|
||||
const { spriteID = 'default', id, format, scale } = req.params;
|
||||
const sanitizedId = String(id);
|
||||
const sanitizedScale = scale ? String(scale) : '';
|
||||
const sanitizedSpriteID = String(spriteID);
|
||||
const sanitizedFormat = format ? '.' + String(format) : '';
|
||||
const sanitizedId = String(id).replace(/\n|\r/g, '');
|
||||
const sanitizedScale = scale ? String(scale).replace(/\n|\r/g, '') : '';
|
||||
const sanitizedSpriteID = String(spriteID).replace(/\n|\r/g, '');
|
||||
const sanitizedFormat = format
|
||||
? '.' + String(format).replace(/\n|\r/g, '')
|
||||
: '';
|
||||
if (verbose) {
|
||||
console.log(
|
||||
`Handling sprite request for: /styles/%s/sprite/%s%s%s`,
|
||||
|
|
Loading…
Reference in a new issue