Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix to call apply_mask with an Array

  • Loading branch information...
commit 7f6528e1900436c1abe538bb26d4a0ea0af3f6fc 1 parent 16781aa
Michael Rykov rykov authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/web_socket.rb
4 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)
Please sign in to comment.
Something went wrong with that request. Please try again.