lib/em-websocket/masking04.rb in em-websocket-0.4.0 vs lib/em-websocket/masking04.rb in em-websocket-0.5.0
- old
+ new
@@ -13,15 +13,11 @@
# Removes the mask, behaves like a normal string again
def unset_mask
@masking_key = nil
end
- def slice_mask
- slice!(0, 4)
- end
-
def getbyte(index)
- if @masking_key
+ if defined?(@masking_key) && @masking_key
masked_char = super
masked_char ? masked_char ^ @masking_key.getbyte(index % 4) : nil
else
super
end