Use `localhost` instead of `::` for local

This commit is contained in:
Daijiro Wachi 2017-06-15 22:29:37 +02:00
parent 1be0a9f3d5
commit 75b4a45968
2 changed files with 2 additions and 4 deletions

View File

@ -632,8 +632,7 @@ app.listen = function(cb) {
} }
if (!self.get('url')) { if (!self.get('url')) {
if (process.platform === 'win32' && listeningOnAll) { if (listeningOnAll) {
// Windows browsers don't support `0.0.0.0` host in the URL
// We are replacing it with localhost to build a URL // We are replacing it with localhost to build a URL
// that can be copied and pasted into the browser. // that can be copied and pasted into the browser.
host = 'localhost'; host = 'localhost';

View File

@ -839,8 +839,7 @@ describe('app', function() {
app.set('host', undefined); app.set('host', undefined);
app.listen(function() { app.listen(function() {
var host = process.platform === 'win32' ? 'localhost' : app.get('host'); var expectedUrl = 'http://localhost:' + app.get('port') + '/';
var expectedUrl = 'http://' + host + ':' + app.get('port') + '/';
expect(app.get('url'), 'url').to.equal(expectedUrl); expect(app.get('url'), 'url').to.equal(expectedUrl);
done(); done();