Websocketd: support for crystal 0.31.0
parent
d6e0bd4a2f
commit
550f4e77ae
|
@ -1,5 +1,5 @@
|
|||
name: networkd
|
||||
version: 0.1.0
|
||||
version: 0.1.1
|
||||
|
||||
authors:
|
||||
- karchnu <karchnu@karchnu.fr>
|
||||
|
|
|
@ -122,10 +122,15 @@ def websocket_client_connection(client, context : InstanceStorage)
|
|||
raise "#REQUEST IS NIL"
|
||||
end
|
||||
|
||||
if request.is_a? HTTP::Request::BadRequest
|
||||
if request.is_a? HTTP::Status && request == HTTP::Status::BAD_REQUEST
|
||||
raise "BAD REQUEST DAZE~"
|
||||
end
|
||||
|
||||
if request.is_a? HTTP::Status
|
||||
raise "Not bad request but still pretty bad: #{request.to_s}"
|
||||
end
|
||||
|
||||
|
||||
# FIXME: check they actually wanted to upgrade to websocket
|
||||
key = request.headers["Sec-WebSocket-Key"]
|
||||
response_key = Digest::SHA1.base64digest key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
|
||||
|
|
Reference in New Issue