diff --git a/package.json b/package.json index 17be179..04fb8e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@extollo/lib", - "version": "0.9.45", + "version": "0.9.46", "description": "The framework library that lifts up your code.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/service/Routing.ts b/src/service/Routing.ts index c6294e4..61d3120 100644 --- a/src/service/Routing.ts +++ b/src/service/Routing.ts @@ -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) }