Merge branch 'feature/mf-queryparams-tile-urls' of https://github.com/targomo/tileserver-gl into feature/mf-queryparams-tile-urls
This commit is contained in:
commit
93c70b3cf4
1 changed files with 15 additions and 0 deletions
|
|
@ -21,6 +21,21 @@ const fixUrl = (req, url, publicUrl, opt_nokey) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Return the query suffix from the original request
|
||||||
|
const getQuery = (req, opt_nokey) => {
|
||||||
|
const queryParams = [];
|
||||||
|
if (!opt_nokey && req.query.key) {
|
||||||
|
queryParams.unshift(`key=${encodeURIComponent(req.query.key)}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
let query = '';
|
||||||
|
if (queryParams.length) {
|
||||||
|
query = `?${queryParams.join('&')}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
// Return the query suffix from the original request
|
// Return the query suffix from the original request
|
||||||
const getQuery = (req, opt_nokey) => {
|
const getQuery = (req, opt_nokey) => {
|
||||||
const queryParams = [];
|
const queryParams = [];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue