mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Don't raise on WS route not found
This commit is contained in:
parent
2b604dfb30
commit
3fd3349383
3 changed files with 21 additions and 7 deletions
|
@ -1,6 +1,19 @@
|
|||
require "./spec_helper"
|
||||
|
||||
describe "Kemal::WebSocketHandler" do
|
||||
it "doesn't match on wrong route" do
|
||||
handler = Kemal::WebSocketHandler.new "/" { }
|
||||
headers = HTTP::Headers{
|
||||
"Upgrade" => "websocket",
|
||||
"Connection" => "Upgrade",
|
||||
"Sec-WebSocket-Key" => "dGhlIHNhbXBsZSBub25jZQ==",
|
||||
}
|
||||
request = HTTP::Request.new("GET", "/asd", headers)
|
||||
io_with_context = create_request_and_return_io(handler, request)
|
||||
client_response = HTTP::Client::Response.from_io(io_with_context, decompress: false)
|
||||
client_response.status_code.should eq(404)
|
||||
end
|
||||
|
||||
it "matches on given route" do
|
||||
handler = Kemal::WebSocketHandler.new "/" { }
|
||||
headers = HTTP::Headers{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue