Skip to content

Commit

Permalink
fix(client): don't override protocol for socket connection to 127.0.0.1
Browse files Browse the repository at this point in the history
Chrome and Firefox accept `http://`/`ws://` mixed-content connection to
`127.0.0.1` even when the actual website is loaded via `https://`.

Fixes webpack#2302
  • Loading branch information
nougad committed Nov 5, 2019
1 parent 969b580 commit 2bc4dd4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client-src/default/utils/createSocketUrl.js
Expand Up @@ -50,6 +50,7 @@ function createSocketUrl(resourceQuery) {
// because the browser doesn't accept non-secure websockets.
if (
hostname &&
hostname !== '127.0.0.1' &&
(self.location.protocol === 'https:' || urlParts.hostname === '0.0.0.0')
) {
protocol = self.location.protocol;
Expand Down

0 comments on commit 2bc4dd4

Please sign in to comment.