mirror of
https://github.com/maptiler/tileserver-gl.git
synced 2024-09-11 03:55:27 +03:00
feat: handle the X-Forwarded-Path header (#1197)
* feat: handle the X-Forwarded-Path header * fix: lint Signed-off-by: acalcutt <acalcutt@techidiots.net> --------- Signed-off-by: acalcutt <acalcutt@techidiots.net> Co-authored-by: Zsolt Jakubinyi <zsolt.jakubinyi@beamtrail.com> Co-authored-by: acalcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
366f71ca44
commit
bff699ba4a
@ -114,9 +114,10 @@ export const getTileUrls = (
|
|||||||
|
|
||||||
const uris = [];
|
const uris = [];
|
||||||
if (!publicUrl) {
|
if (!publicUrl) {
|
||||||
|
let xForwardedPath = `${req.get('X-Forwarded-Path') ? '/' + req.get('X-Forwarded-Path') : ''}`;
|
||||||
for (const domain of domains) {
|
for (const domain of domains) {
|
||||||
uris.push(
|
uris.push(
|
||||||
`${req.protocol}://${domain}/${path}/${tileParams}.${format}${query}`,
|
`${req.protocol}://${domain}${xForwardedPath}/${path}/${tileParams}.${format}${query}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user