mirror of
https://github.com/asphyxia-core/core.git
synced 2026-12-04 22:49:12 -06:00
Reverse port detection when not using reverse proxy
This commit is contained in:
@@ -94,7 +94,11 @@ export const services = (port: number, plugins: EamusePlugin[]) => {
|
||||
|
||||
const host = (info as any).host;
|
||||
const protocol = (info as any).protocol || 'http';
|
||||
const url = `${protocol}://${host}`;
|
||||
const url = (info as any).proxy
|
||||
? `${protocol}://${host}`
|
||||
: port == 80
|
||||
? `http://${host}`
|
||||
: `http://${host}:${port}`;
|
||||
|
||||
for (const moduleName of coreModules) {
|
||||
services.item.push({ '@attr': { name: moduleName, url } });
|
||||
|
||||
@@ -202,6 +202,7 @@ export const EamuseRoute = (router: EamuseRootRouter): RequestHandler => {
|
||||
? stripPort(forwardedHost)
|
||||
: req.get('host') || req.hostname;
|
||||
(info as any).protocol = forwardedProto || req.protocol;
|
||||
(info as any).proxy = Boolean(forwardedHost || forwardedProto);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user