mirror of
https://github.com/faye/websocket-driver-ruby.git
synced 2025-11-01 13:59:38 +00:00
Set status and headers as soon as they are known, so they are available in case of an error.
This commit is contained in:
@@ -67,6 +67,9 @@ module WebSocket
|
||||
end
|
||||
|
||||
def validate_handshake
|
||||
@status = @http.code
|
||||
@headers = Headers.new(@http.headers)
|
||||
|
||||
unless @http.code == 101
|
||||
return fail_handshake("Unexpected response code: #{@http.code}")
|
||||
end
|
||||
@@ -100,8 +103,6 @@ module WebSocket
|
||||
end
|
||||
end
|
||||
|
||||
@status = @http.code
|
||||
@headers = Headers.new(@http.headers)
|
||||
open
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user