imanel / websocket-ruby

Universal Ruby library to handle WebSocket protocol
447 stars 43 forks source link

Make handshake server resilient to non-string Rack env keys. #34

Closed ecin closed 7 years ago

ecin commented 7 years ago

The Rack specification doesn't guarantee that keys inside the Rack env will always be strings (http://www.rubydoc.info/github/rack/rack/master/file/SPEC).

Call #to_s on keys before calling #start_with? on them.

I think the test could be clearer, open to suggestions!

imanel commented 7 years ago

Hi @ecin. Thanks for PR. Could you fix tests so I can merge it?

ecin commented 7 years ago

Hi @imanel! Looks like Travis is failing because it can't find a particular JRuby, and because Rubinius can't find Bundler::Deprecate. I could dive into these errors, but they seem unrelated to the code change.

imanel commented 7 years ago

Fixed it in #35 - could you update your branch so we can merge it cleanly? Thanks

ecin commented 7 years ago

Done. Thanks for the responsiveness, @imanel.

imanel commented 7 years ago

Released with 1.2.5. Thanks for your work!