Skip to content

Commit

Permalink
fix(client-src): don't use self.location.port
Browse files Browse the repository at this point in the history
ISSUE: #1777
REF: #1792
REF: #1664
  • Loading branch information
hiroppy committed May 1, 2019
1 parent 4c52153 commit 9405169
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client-src/default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ const onSocketMsg = {

let hostname = urlParts.hostname;
let protocol = urlParts.protocol;
let port = urlParts.port;

// check ipv4 and ipv6 `all hostname`
if (hostname === '0.0.0.0' || hostname === '::') {
Expand All @@ -208,7 +207,6 @@ if (hostname === '0.0.0.0' || hostname === '::') {
// eslint-disable-next-line no-bitwise
if (self.location.hostname && !!~self.location.protocol.indexOf('http')) {
hostname = self.location.hostname;
port = self.location.port;
}
}

Expand All @@ -228,8 +226,8 @@ const socketUrl = url.format({
hostname,
port:
urlParts.path == null || urlParts.path === '/'
? port
: querystring.parse(urlParts.path).sockPort || port,
? urlParts.port
: querystring.parse(urlParts.path).sockPort || urlParts.port,
// If sockPath is provided it'll be passed in via the __resourceQuery as a
// query param so it has to be parsed out of the querystring in order for the
// client to open the socket to the correct location.
Expand Down

0 comments on commit 9405169

Please sign in to comment.