Skip to content

Commit eff879e

Browse files
committed
Merge pull request CodeByZach#100 from JeremyGeros/master
When protocols is undefined do not pass it to new WebSocket()
2 parents 6c66f13 + 2133c29 commit eff879e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pace.coffee

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ defaultOptions =
6565
trackMethods: ['GET']
6666

6767
# Should we track web socket connections?
68-
trackWebSockets: false
68+
trackWebSockets: true
6969

7070
# A list of regular expressions or substrings of URLS we should ignore (for both tracking and restarting)
7171
ignoreURLs: []
@@ -350,7 +350,10 @@ class RequestIntercept extends Events
350350

351351
if _WebSocket? and options.ajax.trackWebSockets
352352
window.WebSocket = (url, protocols) =>
353-
req = new _WebSocket(url, protocols)
353+
if protocols?
354+
req = new _WebSocket(url, protocols)
355+
else
356+
req = new _WebSocket(url)
354357

355358
if shouldTrack('socket')
356359
@trigger 'request', {type: 'socket', url, protocols, request: req}

0 commit comments

Comments
 (0)