Add support for X-Fowarded-Path as public_url in serveTemplate
This commit is contained in:
parent
4dc97d53b6
commit
b065a187a6
1 changed files with 2 additions and 1 deletions
|
@ -476,7 +476,8 @@ async function start(opts) {
|
||||||
if (data) {
|
if (data) {
|
||||||
data['server_version'] =
|
data['server_version'] =
|
||||||
`${packageJson.name} v${packageJson.version}`;
|
`${packageJson.name} v${packageJson.version}`;
|
||||||
data['public_url'] = opts.publicUrl || '/';
|
let xForwardedPath = req.get('X-Forwarded-Path') ? '/' + req.get('X-Forwarded-Path') : '';
|
||||||
|
data['public_url'] = opts.publicUrl || xForwardedPath + '/';
|
||||||
data['is_light'] = isLight;
|
data['is_light'] = isLight;
|
||||||
data['key_query_part'] = req.query.key
|
data['key_query_part'] = req.query.key
|
||||||
? `key=${encodeURIComponent(req.query.key)}&`
|
? `key=${encodeURIComponent(req.query.key)}&`
|
||||||
|
|
Loading…
Reference in a new issue