Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't drop query variables on handshake #2745

Merged
merged 3 commits into from Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions lib/socket.js
Expand Up @@ -8,6 +8,7 @@ var parser = require('socket.io-parser');
var url = require('url');
var debug = require('debug')('socket.io:socket');
var hasBin = require('has-binary');
var assign = require('object-assign');

/**
* Module exports.
Expand Down Expand Up @@ -110,13 +111,7 @@ Socket.prototype.buildHandshake = function(query){
function buildQuery(){
var requestQuery = url.parse(self.request.url, true).query;
//if socket-specific query exist, replace query strings in requestQuery
if(query){
query.t = requestQuery.t;
query.EIO = requestQuery.EIO;
query.transport = requestQuery.transport;
return query;
}
return requestQuery || {};
return assign({}, query, requestQuery);
}
return {
headers: this.request.headers,
Expand Down
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -24,12 +24,13 @@
"test": "gulp test"
},
"dependencies": {
"debug": "2.2.0",
"engine.io": "1.7.2",
"socket.io-parser": "2.3.1",
"socket.io-client": "1.5.1",
"socket.io-adapter": "0.4.0",
"has-binary": "0.1.7",
"debug": "2.2.0"
"object-assign": "^4.1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please pin the dependency here please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Missed it sorry!

"socket.io-adapter": "0.4.0",
"socket.io-client": "1.5.1",
"socket.io-parser": "2.3.1"
},
"devDependencies": {
"babel-preset-es2015": "6.3.13",
Expand Down