Skip to content
Browse files

Fixed a couple of 1.8.7 bugs - closes #85

  • Loading branch information...
1 parent 3896511 commit 093d5fe67980c4ee889d39c81eb37fad8037b2c1 @mloughran mloughran committed
Showing with 4 additions and 2 deletions.
  1. +2 −1 lib/em-websocket/connection.rb
  2. +2 −1 lib/em-websocket/masking04.rb
View
3 lib/em-websocket/connection.rb
@@ -161,7 +161,8 @@ def send(data)
# Revert data back to the original encoding (which we assume is UTF-8)
# Doing this to avoid duping the string - there may be a better way
- data.force_encoding(UTF8)
+ data.force_encoding(UTF8) if ENCODING_SUPPORTED
+ return nil
end
# Send a ping to the client. The client must respond with a pong.
View
3 lib/em-websocket/masking04.rb
@@ -29,7 +29,8 @@ def getbyte(index)
end
def getbytes(start_index, count)
- data = ''.force_encoding('ASCII-8BIT')
+ data = ''
+ data.force_encoding('ASCII-8BIT') if data.respond_to?(:force_encoding)
count.times do |i|
data << getbyte(start_index + i)
end

0 comments on commit 093d5fe

Please sign in to comment.
Something went wrong with that request. Please try again.