From 63a13c6336efe0145e39bf3e5143e0a0e5f2eca1 Mon Sep 17 00:00:00 2001
From: Kfir Hadas <sharkykh@gmail.com>
Date: Wed, 19 Jul 2017 20:19:38 +0300
Subject: [PATCH] Fix calendar link and CalendarHandler route (allow trailing
 slash) (#3943)

Trailing slash allowance was mysteriously removed by me in #3716
---
 gui/slick/js/core.js      |   2 +-
 gui/slick/js/core.min.js  | Bin 87922 -> 87924 bytes
 sickbeard/webserveInit.py |   4 ++--
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gui/slick/js/core.js b/gui/slick/js/core.js
index 829e851ea..dcbad8e10 100644
--- a/gui/slick/js/core.js
+++ b/gui/slick/js/core.js
@@ -3603,7 +3603,7 @@ var SICKRAGE = {
     schedule: {
         init: function() {
             // Set webcal link for calendar subscription
-            $('.btn-cal-subscribe').attr('href', document.location.href.replace(/https?/, 'webcal').replace('schedule', 'calendar'));
+            $('.btn-cal-subscribe').attr('href', document.location.href.replace(/https?/, 'webcal').replace(/schedule.*/, 'calendar'));
         },
         index: function() {
             if (isMeta('sickbeard.COMING_EPS_LAYOUT', ['list'])) {
diff --git a/gui/slick/js/core.min.js b/gui/slick/js/core.min.js
index 50b51983e919ebd0dd0b07eb2687e9330929ceed..b6380bcb441386ac99132955a5d5a3c969154d47 100644
GIT binary patch
delta 30
lcmeygj`hnr)`l&Ni8?&`#mO0|DWy57dRqG1vvnBRwE@7D3ZDP~

delta 28
jcmeyej`h<z)`l&Ni8@?L#mO0|DWy57O51aF7}>P}t2_!V

diff --git a/sickbeard/webserveInit.py b/sickbeard/webserveInit.py
index 871e669a4..1032f163a 100644
--- a/sickbeard/webserveInit.py
+++ b/sickbeard/webserveInit.py
@@ -132,8 +132,8 @@ class SRWebServer(threading.Thread):  # pylint: disable=too-many-instance-attrib
             (r'{0}/login(/?)'.format(self.options['web_root']), LoginHandler),
             (r'{0}/logout(/?)'.format(self.options['web_root']), LogoutHandler),
 
-            # Web calendar handler (Needed because option Unprotected calendar)
-            (r'{0}/calendar'.format(self.options['web_root']), CalendarHandler),
+            # Web calendar handler (Needed for the "Unprotected Calendar" option)
+            (r'{0}/calendar/?'.format(self.options['web_root']), CalendarHandler),
 
             # webui handlers
         ] + route.get_routes(self.options['web_root']))
-- 
GitLab