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
This commit is contained in:
syeopite 2021-08-09 01:52:42 -07:00
parent 7ddab5b8cd
commit c2297ebc25
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82

View File

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