diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-08-06 19:51:37 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-08-06 19:51:37 -0500 |
| commit | d2d5de55c158f52c8bc71fc5f2db055c3b86e66c (patch) | |
| tree | 4c0801ce40e29c33e1e169d0525b81ff0e92a64d | |
| parent | 4d034bedce8d2a160a7611f6d8b56b22e4a3184b (diff) | |
| download | invidious-d2d5de55c158f52c8bc71fc5f2db055c3b86e66c.tar.gz invidious-d2d5de55c158f52c8bc71fc5f2db055c3b86e66c.tar.bz2 invidious-d2d5de55c158f52c8bc71fc5f2db055c3b86e66c.zip | |
Fix infinite redirect for 'subscription_ajax'
| -rw-r--r-- | src/invidious.cr | 5 |
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) |
