mirror of
https://github.com/faye/websocket-driver-ruby.git
synced 2025-11-01 13:59:38 +00:00
Empty the buffer once the whole handshake response has been received by the client, else HTTP headers are published as messages.
This commit is contained in:
@@ -67,6 +67,7 @@ module WebSocket
|
||||
|
||||
def valid?
|
||||
data = Protocol.encode(@buffer)
|
||||
@buffer = []
|
||||
|
||||
response = Net::HTTPResponse.read_new(Net::BufferedIO.new(StringIO.new(data)))
|
||||
return false unless response.code.to_i == 101
|
||||
|
||||
Reference in New Issue
Block a user