chore: remove unused opt_nokey arg

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
This commit is contained in:
Martin d'Allens 2023-11-21 15:06:11 +01:00
parent f69a2339b8
commit 9a4ef3dedf

View file

@ -11,12 +11,12 @@ import { getPublicUrl } from './utils.js';
const httpTester = /^(http(s)?:)?\/\//; const httpTester = /^(http(s)?:)?\/\//;
const fixUrl = (req, url, publicUrl, opt_nokey) => { const fixUrl = (req, url, publicUrl) => {
if (!url || typeof url !== 'string' || url.indexOf('local://') !== 0) { if (!url || typeof url !== 'string' || url.indexOf('local://') !== 0) {
return url; return url;
} }
const queryParams = []; const queryParams = [];
if (!opt_nokey && req.query.key) { if (req.query.key) {
queryParams.unshift(`key=${encodeURIComponent(req.query.key)}`); queryParams.unshift(`key=${encodeURIComponent(req.query.key)}`);
} }
let query = ''; let query = '';
@ -42,20 +42,10 @@ export const serve_style = {
} }
// mapbox-gl-js viewer cannot handle sprite urls with query // mapbox-gl-js viewer cannot handle sprite urls with query
if (styleJSON_.sprite) { if (styleJSON_.sprite) {
styleJSON_.sprite = fixUrl( styleJSON_.sprite = fixUrl(req, styleJSON_.sprite, item.publicUrl);
req,
styleJSON_.sprite,
item.publicUrl,
false,
);
} }
if (styleJSON_.glyphs) { if (styleJSON_.glyphs) {
styleJSON_.glyphs = fixUrl( styleJSON_.glyphs = fixUrl(req, styleJSON_.glyphs, item.publicUrl);
req,
styleJSON_.glyphs,
item.publicUrl,
false,
);
} }
return res.send(styleJSON_); return res.send(styleJSON_);
}); });