mirror of
https://github.com/maptiler/tileserver-gl.git
synced 2024-09-11 12:05:41 +03:00
chore: remove unused opt_nokey arg
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
This commit is contained in:
parent
f69a2339b8
commit
9a4ef3dedf
@ -11,12 +11,12 @@ import { getPublicUrl } from './utils.js';
|
||||
|
||||
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) {
|
||||
return url;
|
||||
}
|
||||
const queryParams = [];
|
||||
if (!opt_nokey && req.query.key) {
|
||||
if (req.query.key) {
|
||||
queryParams.unshift(`key=${encodeURIComponent(req.query.key)}`);
|
||||
}
|
||||
let query = '';
|
||||
@ -42,20 +42,10 @@ export const serve_style = {
|
||||
}
|
||||
// mapbox-gl-js viewer cannot handle sprite urls with query
|
||||
if (styleJSON_.sprite) {
|
||||
styleJSON_.sprite = fixUrl(
|
||||
req,
|
||||
styleJSON_.sprite,
|
||||
item.publicUrl,
|
||||
false,
|
||||
);
|
||||
styleJSON_.sprite = fixUrl(req, styleJSON_.sprite, item.publicUrl);
|
||||
}
|
||||
if (styleJSON_.glyphs) {
|
||||
styleJSON_.glyphs = fixUrl(
|
||||
req,
|
||||
styleJSON_.glyphs,
|
||||
item.publicUrl,
|
||||
false,
|
||||
);
|
||||
styleJSON_.glyphs = fixUrl(req, styleJSON_.glyphs, item.publicUrl);
|
||||
}
|
||||
return res.send(styleJSON_);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user