Skip to content

Commit 7c7f1a9

Browse files
fix: properly assign options when creating the transport
The query attribute was overwritten, due to the order of arguments in the assignment. The bug was introduced in the refactor (5f47a50).
1 parent d37534e commit 7c7f1a9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/socket.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ class Socket extends Emitter {
121121
if (this.id) query.sid = this.id;
122122

123123
const opts = Object.assign(
124+
{},
125+
this.opts.transportOptions[name],
126+
this.opts,
124127
{
125128
query,
126129
socket: this,
127130
hostname: this.hostname,
128131
secure: this.secure,
129132
port: this.port
130-
},
131-
this.opts.transportOptions[name],
132-
this.opts
133+
}
133134
);
134135

135-
// console.log(opts);
136136
debug("options: %j", opts);
137137

138138
return new transports[name](opts);

lib/transports/polling-xhr.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class XHR extends Polling {
102102
req.on("error", function(err) {
103103
self.onError("xhr poll error", err);
104104
});
105+
this.pollXhr = req;
105106
}
106107
}
107108

0 commit comments

Comments
 (0)