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:
Lukomo 2024-04-23 23:55:39 +04:00 committed by GitHub
parent 366f71ca44
commit bff699ba4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,9 +114,10 @@ export const getTileUrls = (
const uris = [];
if (!publicUrl) {
let xForwardedPath = `${req.get('X-Forwarded-Path') ? '/' + req.get('X-Forwarded-Path') : ''}`;
for (const domain of domains) {
uris.push(
`${req.protocol}://${domain}/${path}/${tileParams}.${format}${query}`,
`${req.protocol}://${domain}${xForwardedPath}/${path}/${tileParams}.${format}${query}`,
);
}
} else {