Permalink
Browse files

[minor] Avoid relying on the `upgradeReq` property

  • Loading branch information...
lpinca committed May 16, 2017
1 parent 127c4ed commit fb5cf83ecdab3d8565d13522e14e0c9cd9386819
Showing with 5 additions and 5 deletions.
  1. +5 −5 transformers/websockets/server.js
@@ -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());

0 comments on commit fb5cf83

Please sign in to comment.