Bugfix: publicUrl is not used in some urls (#605)
In WMTS the publicUrl path was missed and it was not working properly. Similar story about wmts.tmpl: the baseUrl is not working properly when tileserver is hidden behind the proxy with different root path. * Minor bugfix: make baseUrl always use '/' in the end Co-authored-by: Oleksandr Shyshatskyi <oshyshatskyi@cloudlinux.com> Co-authored-by: acalcutt <acalcutt@techidiots.net>
This commit is contained in:
@@ -420,7 +420,12 @@ export function server(opts) {
|
||||
}
|
||||
wmts.id = id;
|
||||
wmts.name = (serving.styles[id] || serving.rendered[id]).name;
|
||||
wmts.baseUrl = `${req.get('X-Forwarded-Protocol') ? req.get('X-Forwarded-Protocol') : req.protocol}://${req.get('host')}`;
|
||||
if (opts.publicUrl) {
|
||||
wmts.baseUrl = opts.publicUrl;
|
||||
}
|
||||
else {
|
||||
wmts.baseUrl = `${req.get('X-Forwarded-Protocol') ? req.get('X-Forwarded-Protocol') : req.protocol}://${req.get('host')}/`;
|
||||
}
|
||||
return wmts;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user