mirror of
https://github.com/strapi/strapi.git
synced 2025-09-29 18:33:31 +00:00
in dev mode use localhost has default hostname
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
59332ae672
commit
f306feedd2
10
packages/strapi/lib/core/bootstrap.js
vendored
10
packages/strapi/lib/core/bootstrap.js
vendored
@ -322,6 +322,14 @@ module.exports = function(strapi) {
|
|||||||
_.get(strapi.config.currentEnvironment, 'server.host') ||
|
_.get(strapi.config.currentEnvironment, 'server.host') ||
|
||||||
strapi.config.host;
|
strapi.config.host;
|
||||||
|
|
||||||
|
let hostname = strapi.config.host;
|
||||||
|
if (
|
||||||
|
strapi.config.environment === 'development' &&
|
||||||
|
['127.0.0.1', '0.0.0.0'].includes(strapi.config.host)
|
||||||
|
) {
|
||||||
|
hostname = 'localhost';
|
||||||
|
}
|
||||||
|
|
||||||
// proxy settings
|
// proxy settings
|
||||||
const proxy = _.get(strapi.config.currentEnvironment, 'server.proxy', {});
|
const proxy = _.get(strapi.config.currentEnvironment, 'server.proxy', {});
|
||||||
strapi.config.proxy = proxy;
|
strapi.config.proxy = proxy;
|
||||||
@ -334,7 +342,7 @@ module.exports = function(strapi) {
|
|||||||
ssl: proxy.ssl,
|
ssl: proxy.ssl,
|
||||||
})
|
})
|
||||||
: getURLFromSegments({
|
: getURLFromSegments({
|
||||||
hostname: strapi.config.host,
|
hostname,
|
||||||
port: strapi.config.port,
|
port: strapi.config.port,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user