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

socket.request.headers.cookie returns string, not object #2

Open
garrensweet opened this issue Apr 15, 2016 · 0 comments
Open

socket.request.headers.cookie returns string, not object #2

garrensweet opened this issue Apr 15, 2016 · 0 comments

Comments

@garrensweet
Copy link

garrensweet commented Apr 15, 2016

Hello,

I've looked and dug around for quite some time and I can't find a reason for this, however, in some environments the return from socket.request.headers.cookie is actually a string, and not an object.

I have tried in a few environments with the same code and had a 100% success rate getting a string. Here's a tear down of a much larger application to reproduce:

var http = require('http'),
      cookieParser = require('socket.io-cookie-parser');

var app = http.createServer( function( req, res) {
} ).listen(3000);

var io = require('socket.io')(app);

io.use(cookieParser()).use(function(socket, next){ 
    console.log(typeof socket.request.headers.cookie);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant