mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Routes: Run 'before_all' handler in case of a 404
This commit is contained in:
parent
2a7ae83ad2
commit
3bfe51a60f
1 changed files with 6 additions and 0 deletions
|
@ -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 a new issue