Merge pull request #3450 from watilde/fixes-3179

Use `localhost` instead of `::` for local
This commit is contained in:
Miroslav Bajtoš 2017-06-21 17:51:24 +02:00 committed by GitHub
commit f85551b715
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();