mirror of
https://github.com/strapi/strapi.git
synced 2025-09-28 18:01:26 +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') ||
|
||||
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
|
||||
const proxy = _.get(strapi.config.currentEnvironment, 'server.proxy', {});
|
||||
strapi.config.proxy = proxy;
|
||||
@ -334,7 +342,7 @@ module.exports = function(strapi) {
|
||||
ssl: proxy.ssl,
|
||||
})
|
||||
: getURLFromSegments({
|
||||
hostname: strapi.config.host,
|
||||
hostname,
|
||||
port: strapi.config.port,
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user