mirror of
https://github.com/iv-org/invidious.git
synced 2025-02-20 01:08:48 +05:30
Ensure before_all handler is called first
This commit is contained in:
parent
5bf4e20c5a
commit
49c40b3bc3
@ -207,9 +207,9 @@ end
|
||||
|
||||
# Routing
|
||||
|
||||
before_all do |env|
|
||||
Invidious::Routes::BeforeAll.handle(env)
|
||||
end
|
||||
# Custom handlers actually has a higher priority than the handler defined via
|
||||
# before_all
|
||||
add_handler TrueBeforeAllHandler.new
|
||||
|
||||
Invidious::Routing.register_all
|
||||
|
||||
|
@ -60,6 +60,14 @@ class Kemal::ExceptionHandler
|
||||
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
|
||||
exclude ["/videoplayback", "/videoplayback/*", "/vi/*", "/sb/*", "/ggpht/*", "/api/v1/auth/notifications"]
|
||||
exclude ["/api/v1/auth/notifications", "/data_control"], "POST"
|
||||
|
Loading…
x
Reference in New Issue
Block a user