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) {
|
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)}&`
|
||||||
|
@ -679,11 +680,12 @@ async function start(opts) {
|
||||||
if (opts.publicUrl) {
|
if (opts.publicUrl) {
|
||||||
baseUrl = opts.publicUrl;
|
baseUrl = opts.publicUrl;
|
||||||
} else {
|
} else {
|
||||||
|
let xForwardedPath = req.get('X-Forwarded-Path') ? '/' + req.get('X-Forwarded-Path') : '';
|
||||||
baseUrl = `${
|
baseUrl = `${
|
||||||
req.get('X-Forwarded-Protocol')
|
req.get('X-Forwarded-Protocol')
|
||||||
? req.get('X-Forwarded-Protocol')
|
? req.get('X-Forwarded-Protocol')
|
||||||
: req.protocol
|
: req.protocol
|
||||||
}://${req.get('host')}/`;
|
}://${req.get('host')}${xForwardedPath}/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue