Routes: Run 'before_all' handler in case of a 404

pull/3990/head
Samantaz Fox 2023-09-17 14:49:20 +02:00
rodzic 72d2817c36
commit 9b40600835
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F42821059186176E
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -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}"