Skip to content

Commit

Permalink
fix: properly assign options when creating the transport
Browse files Browse the repository at this point in the history
The query attribute was overwritten, due to the order of arguments in
the assignment. The bug was introduced in the refactor (5f47a50).
  • Loading branch information
darrachequesne committed Feb 12, 2020
1 parent d37534e commit 7c7f1a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ class Socket extends Emitter {
if (this.id) query.sid = this.id;

const opts = Object.assign(
{},
this.opts.transportOptions[name],
this.opts,
{
query,
socket: this,
hostname: this.hostname,
secure: this.secure,
port: this.port
},
this.opts.transportOptions[name],
this.opts
}
);

// console.log(opts);
debug("options: %j", opts);

return new transports[name](opts);
Expand Down
1 change: 1 addition & 0 deletions lib/transports/polling-xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class XHR extends Polling {
req.on("error", function(err) {
self.onError("xhr poll error", err);
});
this.pollXhr = req;
}
}

Expand Down

0 comments on commit 7c7f1a9

Please sign in to comment.