mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-26 08:42:08 +05:30
Routes: Run 'before_all' handler in case of a 404
This commit is contained in:
parent
72d2817c36
commit
9b40600835
@ -1,5 +1,11 @@
|
||||
module Invidious::Routes::ErrorRoutes
|
||||
def self.error_404(env)
|
||||
# Try to fetch user account/preferences and add CSP headers
|
||||
begin
|
||||
BeforeAll.handle(env)
|
||||
rescue ex
|
||||
end
|
||||
|
||||
# Workaround for #3117
|
||||
if HOST_URL.empty? && env.request.path.starts_with?("/v1/storyboards/sb")
|
||||
return env.redirect "#{env.request.path[15..]}?#{env.params.query}"
|
||||
|
Loading…
Reference in New Issue
Block a user