Permalink
Browse files

Fix to call apply_mask with an Array

  • Loading branch information...
1 parent 16781aa commit 7f6528e1900436c1abe538bb26d4a0ea0af3f6fc @rykov rykov committed Oct 12, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/web_socket.rb
View
@@ -315,8 +315,8 @@ def send_frame(opcode, payload, mask)
buffer.write([payload.bytesize / (2 ** 32), payload.bytesize % (2 ** 32)].pack("NN"))
end
if mask
- mask_key = Array.new(4){ rand(256) }.pack("C")
- buffer.write(mask_key)
+ mask_key = Array.new(4){ rand(256) }
+ buffer.write(mask_key.pack("C*"))
payload = apply_mask(payload, mask_key)
end
buffer.write(payload)

0 comments on commit 7f6528e

Please sign in to comment.