From c2297ebc25b6ab636ba7929eaf3ad056f3a15372 Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 9 Aug 2021 01:52:42 -0700 Subject: [PATCH] Fix error next steps not showing on playlist pages When validating if an Invidious page is available on YouTube, we used the `env.request.path` variable which doesn't contain url parameters, something that is needed for differentiating IV and YT playlists --- src/invidious/helpers/errors.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index e1d02563..dde0d2df 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -109,10 +109,10 @@ def error_json_helper(env : HTTP::Server::Context, locale : Hash(String, JSON::A end def error_redirect_helper(env : HTTP::Server::Context, locale : Hash(String, JSON::Any) | Nil) - request_path = env.request.path + request_resource = env.request.resource - if request_path.starts_with?("/search") || request_path.starts_with?("/watch") || - request_path.starts_with?("/channel") || request_path.starts_with?("/playlist?list=PL") + if request_resource.starts_with?("/search") || request_resource.starts_with?("/watch") || + request_resource.starts_with?("/channel") || request_resource.starts_with?("/playlist?list=PL") next_steps_text = translate(locale, "next_steps_error_message") refresh = translate(locale, "next_steps_error_message_refresh") go_to_youtube = translate(locale, "next_steps_error_message_go_to_youtube")