Merge pull request #1223 from hedgedoc/fix/useSSL

Automatically enable protocolUseSSL when useSSL is set
This commit is contained in:
David Mehren 2021-05-06 21:24:49 +02:00 committed by GitHub
commit cec032d151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,3 @@
'use strict' 'use strict'
const crypto = require('crypto') const crypto = require('crypto')
@ -88,6 +87,14 @@ config.isStandardHTTPPort = (function isStandardHTTPPort () {
return !config.useSSL && config.port === 80 return !config.useSSL && config.port === 80
})() })()
// Use HTTPS protocol if the internal TLS server is enabled
if (config.useSSL === true) {
if (config.protocolUseSSL === false) {
logger.warn('Overriding protocolUseSSL to \'true\' as useSSL is enabled.')
}
config.protocolUseSSL = true
}
// cache serverURL // cache serverURL
config.serverURL = (function getserverurl () { config.serverURL = (function getserverurl () {
let url = '' let url = ''