Skip to content

Commit

Permalink
[minor] Avoid relying on the upgradeReq property
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed May 16, 2017
1 parent 127c4ed commit fb5cf83
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions transformers/websockets/server.js
Expand Up @@ -34,11 +34,11 @@ module.exports = function server() {
this.on('upgrade', (req, socket, head) => {
this.service.handleUpgrade(req, socket, head, (socket) => {
const spark = new this.Spark(
socket.upgradeReq.headers // HTTP request headers.
, socket.upgradeReq // IP address location.
, url.parse(socket.upgradeReq.url).query // Optional query string.
, null // We don't have an unique id.
, socket.upgradeReq // Reference to the HTTP req.
req.headers // HTTP request headers.
, req // IP address location.
, url.parse(req.url).query // Optional query string.
, null // We don't have an unique id.
, req // Reference to the HTTP req.
);

spark.on('outgoing::end', () => socket && socket.close());
Expand Down

0 comments on commit fb5cf83

Please sign in to comment.