this.req.headers.upgrade is undefined when trying to call toLowerCase()
Problem
Hi guys, First of all apologies I can't be more helpful with this bug report - it occurred on a production server thus logging was down to its minimum level. I'm also not very familiar with all the magic which socket.io provides, but here it is anyway. All of a sudden, my server app crashed, and the following was all I had in the log: [code block] It looks like something unexpected happened when a new client tried to connect to the server - with my poor HTTP knowledge it looks like socket.io is always expecting an upgrade header which it didn't receive? I suspect the fact that I am _only_ supporting the websocket transport (e.g. io.set('transports', ['websocket']) may be relevant - perhaps an old client tried to connect which refused to send the upgrade header. Not sure. Using latest release, 0.8.6 for both client and server: [code block] Anything else I can provide you with to help, just shout.
Error Output
Error: Cannot call method 'toLowerCase' of undefined
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: this.req.headers.upgrade is undefined when trying to call toLowerCase()
In case it's of any relevance, I'm connecting on the client side simply using: [code block] Haven't been able to reproduce this behaviour yet in any browser.
Trust Score
1 verification
- 1
In case it's of any relevance, I'm connecting on the client side simply using:
In case it's of any relevance, I'm connecting on the client side simply using:
textvar socket = io.connect(); - 2
Haven't been able to reproduce this behaviour yet in any browser.
Haven't been able to reproduce this behaviour yet in any browser.
Validation
Resolved in socketio/socket.io GitHub issue #602. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep