From 099ba2c395467808e5f017ba07816393b2c1ded1 Mon Sep 17 00:00:00 2001 From: guidomocha Date: Sat, 22 Jan 2022 22:37:31 +0330 Subject: [PATCH] use x-map-root-url header to generate publicUrl accessing via proxy --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index ab535a8..ba74019 100644 --- a/src/utils.js +++ b/src/utils.js @@ -7,7 +7,7 @@ const clone = require('clone'); const glyphCompose = require('@mapbox/glyph-pbf-composite'); -module.exports.getPublicUrl = (publicUrl, req) => publicUrl || (req.headers.x-forwarded-host ? `${req.headers.x-forwarded-proto || req.protocol}://${req.headers.x-forwarded-host}/` : `${req.protocol}://${req.headers.host}/`); +module.exports.getPublicUrl = (publicUrl, req) => publicUrl || (req.headers.x-forwarded-host ? `${req.headers.x-forwarded-proto || req.protocol}://${req.headers.x-forwarded-host}${req.headers.x-map-root-url}/` : `${req.protocol}://${req.headers.host}/`); module.exports.getTileUrls = (req, domains, path, format, publicUrl, aliases) => {