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:
James Coglan
2013-04-20 14:56:44 +01:00
parent 56dd161ee1
commit eee225441e
+1
View File
@@ -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