lib/em-websocket/handler76.rb in em-websocket-0.1.3 vs lib/em-websocket/handler76.rb in em-websocket-0.1.4

- old
+ new

@@ -5,11 +5,11 @@ class Handler76 < Handler # "\377\000" is octet version and "\xff\x00" is hex version TERMINATE_STRING = "\xff\x00" def handshake - challenge_response = solve_challange( + challenge_response = solve_challenge( @request['Sec-WebSocket-Key1'], @request['Sec-WebSocket-Key2'], @request['Third-Key'] ) @@ -34,10 +34,10 @@ return upgrade end private - def solve_challange(first, second, third) + def solve_challenge(first, second, third) # Refer to 5.2 4-9 of the draft 76 sum = [(extract_nums(first) / count_spaces(first))].pack("N*") + [(extract_nums(second) / count_spaces(second))].pack("N*") + third Digest::MD5.digest(sum)