lib/rev/websocket.rb in rev-websocket-0.1.0 vs lib/rev/websocket.rb in rev-websocket-0.1.1
- old
+ new
@@ -85,11 +85,11 @@
close
end
return false unless @http11.finished?
- @data.read(@http11_nbytes)
+ @data.read(@http11_nbytes-1)
remove_instance_variable(:@http11)
remove_instance_variable(:@http11_nbytes)
@request.delete(DummyIO::KEY)
@@ -116,10 +116,13 @@
on_open
end
rescue
on_bad_request
+ return false
end
+
+ return true
end
def on_bad_request
write "HTTP/1.1 400 Bad request\r\n\r\n"
close