|
|
|
@ -168,10 +168,15 @@ export class Routing extends Unit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getAppUrl(): UniversalPath {
|
|
|
|
|
const forceSsl = Boolean(this.config.get('server.forceSsl', false))
|
|
|
|
|
|
|
|
|
|
if ( this.request.has() ) {
|
|
|
|
|
// If we have a request context, use that URL, as it is the most reliable
|
|
|
|
|
const request = this.request.get()
|
|
|
|
|
const url = new URL(request.fullUrl)
|
|
|
|
|
if ( forceSsl ) {
|
|
|
|
|
url.protocol = 'https:'
|
|
|
|
|
}
|
|
|
|
|
return universalPath(url.origin)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|