Skip to content

Commit e85e8f6

Browse files
committed
Merge pull request #338 from grammarly/fix_socket_path
fix socket pathname
2 parents 434651f + ee1ca13 commit e85e8f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var scriptHost = scriptElements[scriptElements.length-1].getAttribute("src").rep
88
// Else, get the url from the <script> this file was called with.
99
var urlParts = url.parse(typeof __resourceQuery === "string" && __resourceQuery ?
1010
__resourceQuery.substr(1) :
11-
(scriptHost ? scriptHost : "/")
11+
(scriptHost ? scriptHost : "/"), false, true
1212
);
1313

1414
var sock = null;
@@ -63,7 +63,7 @@ var newConnection = function() {
6363
auth: urlParts.auth,
6464
hostname: (urlParts.hostname === '0.0.0.0') ? window.location.hostname : urlParts.hostname,
6565
port: urlParts.port,
66-
pathname: urlParts.path === '/' ? "/sockjs-node" : urlParts.path
66+
pathname: urlParts.path == null || urlParts.path === '/' ? "/sockjs-node" : urlParts.path
6767
}));
6868

6969
sock.onclose = function() {

0 commit comments

Comments
 (0)