tileserver-gl 4.11.0 → 4.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils.js CHANGED
@@ -48,6 +48,12 @@ const getUrlObject = (req) => {
48
48
  const urlObject = new URL(`${req.protocol}://${req.headers.host}/`);
49
49
  // support overriding hostname by sending X-Forwarded-Host http header
50
50
  urlObject.hostname = req.hostname;
51
+
52
+ // support add url prefix by sending X-Forwarded-Path http header
53
+ const xForwardedPath = req.get('X-Forwarded-Path');
54
+ if (xForwardedPath) {
55
+ urlObject.pathname = path.posix.join(xForwardedPath, urlObject.pathname);
56
+ }
51
57
  return urlObject;
52
58
  };
53
59