Skip to content

Commit 9405169

Browse files
committed
fix(client-src): don't use self.location.port
ISSUE: #1777 REF: #1792 REF: #1664
1 parent 4c52153 commit 9405169

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

client-src/default/index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ const onSocketMsg = {
198198

199199
let hostname = urlParts.hostname;
200200
let protocol = urlParts.protocol;
201-
let port = urlParts.port;
202201

203202
// check ipv4 and ipv6 `all hostname`
204203
if (hostname === '0.0.0.0' || hostname === '::') {
@@ -208,7 +207,6 @@ if (hostname === '0.0.0.0' || hostname === '::') {
208207
// eslint-disable-next-line no-bitwise
209208
if (self.location.hostname && !!~self.location.protocol.indexOf('http')) {
210209
hostname = self.location.hostname;
211-
port = self.location.port;
212210
}
213211
}
214212

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

0 commit comments

Comments
 (0)