-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pick a different instance upon redirect #5154
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crystal if blocks needs to be explicitly closed with an end
statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the lint issues.
src/invidious/routes/misc.cr
Outdated
@@ -42,12 +42,17 @@ module Invidious::Routes::Misc | |||
referer = get_referer(env) | |||
|
|||
instance_list = Invidious::Jobs::InstanceListRefreshJob::INSTANCES["INSTANCES"] | |||
if instance_list.empty? | |||
# Filter out the current instance | |||
other_available_instances = instance_list.reject! { |_, domain| domain == CONFIG.domain } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other_available_instances = instance_list.reject! { |_, domain| domain == CONFIG.domain } | |
other_available_instances = instance_list.reject { |_, domain| domain == CONFIG.domain } |
reject!
modifies itself instead of creating a new Tuple. other_available_instances
isn't necessary unless you're using reject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Currently, the redirect url may redirect the user back to the same instance they are currently on.