Skip to content

Commit

Permalink
feat: handle the X-Forwarded-Path header (#1197)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Apr 23, 2024
1 parent 366f71c commit bff699b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bff699b

Please sign in to comment.