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
|
@ -13,12 +13,13 @@ class HTTP::Server
|
|||
end
|
||||
|
||||
def params
|
||||
websocket? = @request.headers.has_key?("Upgrade")
|
||||
@request.url_params ||= unless websocket?
|
||||
route_lookup.params
|
||||
else
|
||||
ws_route_lookup.params
|
||||
end
|
||||
connection_type = @request.headers.fetch("Connection", nil)
|
||||
@request.url_params ||= unless connection_type == "Upgrade"
|
||||
route_lookup.params
|
||||
else
|
||||
ws_route_lookup.params
|
||||
end
|
||||
|
||||
@params ||= if @request.param_parser
|
||||
@request.param_parser.not_nil!
|
||||
else
|
||||
|
|
|
@ -8,7 +8,7 @@ module Kemal
|
|||
end
|
||||
|
||||
def call(context)
|
||||
raise Kemal::Exceptions::RouteNotFound.new(context) unless context.ws_route_defined?
|
||||
return call_next(context) unless context.ws_route_defined?
|
||||
super
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue