Fix: missing custom port on re-written links

When a link was rewritten and the site is running in a custom
(ie, not protocol standard - http/80, https/443) port, the links
became invalid.

We now include them only when necessary.
This commit is contained in:
mgarciaisaia
2021-05-27 01:02:49 -03:00
parent 61e0c455fc
commit 1f222fe0b1
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -48,8 +48,10 @@ if(config.https_enabled) {
}
https = require('https').Server(credentials, app)
global.protocol = 'https://'
global.custom_port = config.ssl_port === '443' ? '' : `:${config.ssl_port}`
} else {
global.protocol = 'http://'
global.custom_port = config.nonssl_port === '80' ? '' : `:${config.nonssl_port}`
}
const http = require('http').Server(app)