mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Fix undefined config URL in some cases
This commit is contained in:
parent
5e2ac2f953
commit
228247eb86
16
lib/load.js
16
lib/load.js
@ -122,15 +122,15 @@ module.exports = strapi => {
|
||||
}
|
||||
|
||||
// Automatically define the server URL from
|
||||
// `proxy`, `ssl`, `host`, `port` and `prefix` config.
|
||||
if (_.isPlainObject(strapi.config.ssl)) {
|
||||
if (_.isString(strapi.config.proxy)) {
|
||||
strapi.config.url = strapi.config.proxy;
|
||||
} else if (strapi.config.ssl.disabled === false && strapi.config.proxy === false) {
|
||||
strapi.config.url = 'https://' + strapi.config.host + ':' + strapi.config.port;
|
||||
}
|
||||
// `proxy`, `ssl`, `host`, and `port` config.
|
||||
if (_.isString(strapi.config.proxy)) {
|
||||
strapi.config.url = strapi.config.proxy;
|
||||
} else {
|
||||
strapi.config.url = 'http://' + strapi.config.host + ':' + strapi.config.port;
|
||||
if (_.isPlainObject(strapi.config.ssl) && strapi.config.ssl.disabled === false) {
|
||||
strapi.config.url = 'https://' + strapi.config.host + ':' + strapi.config.port;
|
||||
} else {
|
||||
strapi.config.url = 'http://' + strapi.config.host + ':' + strapi.config.port;
|
||||
}
|
||||
}
|
||||
|
||||
// We can finally make the server listen on the configured port.
|
||||
|
||||
@ -132,6 +132,7 @@
|
||||
"no-implicit-coercion": 0,
|
||||
"no-inner-declarations": 0,
|
||||
"no-invalid-this": 0,
|
||||
"no-lonely-if": 0,
|
||||
"no-negated-condition": 0,
|
||||
"no-throw-literal": 0,
|
||||
"no-unused-expressions": 0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user