igrigorik/em-websocket — pull request #76 by iblue (2012-04-19 09:52:40+00:00)
Title: Raise HandshakeError on malformed requests (empty header)

My em-websocket crashed in production, because someone sent an empty http header (request looks `"\r\n\r\nfoobar"`). This was the backtrace:

```
NoMethodError: undefined method `match' for nil:NilClass:
/em-websocket-0.3.6/lib/em-websocket/handler_factory.rb:19:in `build'
/em-websocket-0.3.6/lib/em-websocket/connection.rb:108:in `dispatch'
/em-websocket-0.3.6/lib/em-websocket/connection.rb:71:in `receive_data'
/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
```

My patch fixes this.