Merge b065a187a6
into cd613e2fb5
This commit is contained in:
commit
c43e8c5bd1
1 changed files with 4 additions and 2 deletions
|
@ -497,7 +497,8 @@ async function start(opts) {
|
|||
if (data) {
|
||||
data['server_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['key_query_part'] = req.query.key
|
||||
? `key=${encodeURIComponent(req.query.key)}&`
|
||||
|
@ -679,11 +680,12 @@ async function start(opts) {
|
|||
if (opts.publicUrl) {
|
||||
baseUrl = opts.publicUrl;
|
||||
} else {
|
||||
let xForwardedPath = req.get('X-Forwarded-Path') ? '/' + req.get('X-Forwarded-Path') : '';
|
||||
baseUrl = `${
|
||||
req.get('X-Forwarded-Protocol')
|
||||
? req.get('X-Forwarded-Protocol')
|
||||
: req.protocol
|
||||
}://${req.get('host')}/`;
|
||||
}://${req.get('host')}${xForwardedPath}/`;
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue