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:
Mario Freitas 2020-08-10 15:43:31 +02:00
commit 93c70b3cf4

View file

@ -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
const getQuery = (req, opt_nokey) => {
const queryParams = [];