Skip to content

Commit

Permalink
Fix to call apply_mask with an Array
Browse files Browse the repository at this point in the history
  • Loading branch information
rykov committed Oct 12, 2011
1 parent 16781aa commit 7f6528e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/web_socket.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 7f6528e

Please sign in to comment.