From a9b675cd2438d27934dc67eec3eeb251ee2a151f Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Wed, 20 Apr 2022 14:55:19 -0600 Subject: [PATCH] Strip trailing slash on root url in filter If a trailing slash is defined here, it causes the Whoogle instance to redirect these element requests back to the home page, causing unwanted behavior. --- app/filter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/filter.py b/app/filter.py index f721fb1..24ba8a0 100644 --- a/app/filter.py +++ b/app/filter.py @@ -93,12 +93,13 @@ class Filter: self.config = config self.mobile = mobile self.user_key = user_key - self.root_url = root_url self.page_url = page_url self.main_divs = ResultSet('') self._elements = 0 self._av = set() + self.root_url = root_url[:-1] if root_url.endswith('/') else root_url + def __getitem__(self, name): return getattr(self, name)