diff --git a/src/invidious/routes/errors.cr b/src/invidious/routes/errors.cr index f6b94df3d..d0622621a 100644 --- a/src/invidious/routes/errors.cr +++ b/src/invidious/routes/errors.cr @@ -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}"