summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-06 19:51:37 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-06 19:51:37 -0500
commitd2d5de55c158f52c8bc71fc5f2db055c3b86e66c (patch)
tree4c0801ce40e29c33e1e169d0525b81ff0e92a64d /src
parent4d034bedce8d2a160a7611f6d8b56b22e4a3184b (diff)
downloadinvidious-d2d5de55c158f52c8bc71fc5f2db055c3b86e66c.tar.gz
invidious-d2d5de55c158f52c8bc71fc5f2db055c3b86e66c.tar.bz2
invidious-d2d5de55c158f52c8bc71fc5f2db055c3b86e66c.zip
Fix infinite redirect for 'subscription_ajax'
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index defd3254..8a3b8ae3 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -1051,7 +1051,10 @@ end
get "/subscription_ajax" do |env|
user = env.get? "user"
referer = env.request.headers["referer"]?
- referer ||= "/"
+
+ if !referer || URI.parse(referer).path.try &.== "/subscription_ajax"
+ referer = "/"
+ end
if user
user = user.as(User)