From 173cd7c15ea3aa044c9852572f99691c943d64a0 Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 15 May 2021 21:10:53 -0700 Subject: [PATCH] Fix switch invidious instance btn on videos --- src/invidious/helpers/utils.cr | 2 +- src/invidious/views/components/item.ecr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index 7c573aba..ec8aee9e 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -435,7 +435,7 @@ def fetch_random_instance end if !broken_health_monitoring - health = data[1]["monitor"].as_h["dailyRatios"][0].as_h["ratio"] + health = data[1]["monitor"].as_h["dailyRatios"][0].as_h["ratio"] filtered_instance_list << data[0].as_s if health.to_s.to_f > 90 else # We can't check the health if the monitoring is broken. Thus we'll just add it to the list diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index 532de6ac..6f027bee 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -148,7 +148,7 @@ " href="/watch?v=<%= item.id %>&listen=1"> - " href="/redirect?referer=<%= env.get?("current_page") %>"> + " href="/redirect?referer=<%=HTML.escape("watch?v=#{item.id}")%>">