facebook/tornado — pull request #417 by MrJoes (2011-12-10 10:04:21+00:00)
Title: Additional sanity checks for websockets transport handshake

Following is true for all version of the websockets:
2. The Method of the request MUST be GET and the HTTP version MUST
be at least 1.1.
5. The request MUST contain an "Upgrade" header field whose value
is equal to "websocket".
6. The request MUST contain a "Connection" header field whose value
MUST include the "Upgrade" token.

Previous implementation was closing connection if some of the headers were missing instead of sending proper response code, which caused troubles for older browsers as they did not get any response and didn't know how to react.