mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-14 17:38:29 +00:00
Ensure before_all handler is called first
This commit is contained in:
parent
5bf4e20c5a
commit
49c40b3bc3
@ -207,9 +207,9 @@ end
|
|||||||
|
|
||||||
# Routing
|
# Routing
|
||||||
|
|
||||||
before_all do |env|
|
# Custom handlers actually has a higher priority than the handler defined via
|
||||||
Invidious::Routes::BeforeAll.handle(env)
|
# before_all
|
||||||
end
|
add_handler TrueBeforeAllHandler.new
|
||||||
|
|
||||||
Invidious::Routing.register_all
|
Invidious::Routing.register_all
|
||||||
|
|
||||||
|
@ -60,6 +60,14 @@ class Kemal::ExceptionHandler
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class TrueBeforeAllHandler < Kemal::Handler
|
||||||
|
def call(env)
|
||||||
|
return call_next(env) unless env.route_found?
|
||||||
|
Invidious::Routes::BeforeAll.handle(env)
|
||||||
|
call_next env
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class FilteredCompressHandler < Kemal::Handler
|
class FilteredCompressHandler < Kemal::Handler
|
||||||
exclude ["/videoplayback", "/videoplayback/*", "/vi/*", "/sb/*", "/ggpht/*", "/api/v1/auth/notifications"]
|
exclude ["/videoplayback", "/videoplayback/*", "/vi/*", "/sb/*", "/ggpht/*", "/api/v1/auth/notifications"]
|
||||||
exclude ["/api/v1/auth/notifications", "/data_control"], "POST"
|
exclude ["/api/v1/auth/notifications", "/data_control"], "POST"
|
||||||
|
Loading…
Reference in New Issue
Block a user