Skip to content

Commit 67c64ae

Browse files
authored
Merge branch 'master' into https-fix
2 parents 9b49e26 + 3a31917 commit 67c64ae

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

client-src/default/utils/createSocketUrl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ function createSocketUrl(resourceQuery) {
4646
// because the browser doesn't accept non-secure websockets.
4747
if (
4848
hostname &&
49+
hostname !== '127.0.0.1' &&
4950
(self.location.protocol === 'https:' || urlParts.hostname === '0.0.0.0')
5051
) {
5152
protocol = self.location.protocol;

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"less-loader": "^5.0.0",
100100
"lint-staged": "^9.4.3",
101101
"marked": "^0.7.0",
102-
"memfs": "^2.16.1",
102+
"memfs": "^3.0.1",
103103
"npm-run-all": "^4.1.5",
104104
"prettier": "^1.19.1",
105105
"puppeteer": "^1.20.0",

test/client/utils/__snapshots__/createSocketUrl.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ exports[`createSocketUrl should return the url when __resourceQuery is ?test 1`]
44

55
exports[`createSocketUrl should return the url when __resourceQuery is http://0.0.0.0 1`] = `"http://localhost/sockjs-node"`;
66

7+
exports[`createSocketUrl should return the url when __resourceQuery is http://127.0.0.1 1`] = `"http://127.0.0.1/sockjs-node"`;
8+
79
exports[`createSocketUrl should return the url when __resourceQuery is http://user:pass@[::]:8080 1`] = `"http://user:pass@localhost:8080/sockjs-node"`;
810

911
exports[`createSocketUrl should return the url when __resourceQuery is http://user:password@localhost/ 1`] = `"http://user:password@localhost/sockjs-node"`;
@@ -22,6 +24,8 @@ exports[`createSocketUrl should return the url when the current script source is
2224

2325
exports[`createSocketUrl should return the url when the current script source is http://0.0.0.0 1`] = `"http://localhost/sockjs-node"`;
2426

27+
exports[`createSocketUrl should return the url when the current script source is http://127.0.0.1 1`] = `"http://127.0.0.1/sockjs-node"`;
28+
2529
exports[`createSocketUrl should return the url when the current script source is http://user:pass@[::]:8080 1`] = `"http://user:pass@localhost:8080/sockjs-node"`;
2630

2731
exports[`createSocketUrl should return the url when the current script source is http://user:password@localhost/ 1`] = `"http://user:password@localhost/sockjs-node"`;

test/client/utils/createSocketUrl.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe('createSocketUrl', () => {
1010
'http://0.0.0.0',
1111
'https://localhost:123',
1212
'http://user:pass@[::]:8080',
13+
'http://127.0.0.1',
1314
// TODO: comment out after the major release
1415
// https://github.com/webpack/webpack-dev-server/pull/1954#issuecomment-498043376
1516
// 'file://filename',

0 commit comments

Comments
 (0)