summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--requirements-dev.txt1
-rwxr-xr-xsearx/webapp.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 189fd5a7d..2fad45f14 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -8,6 +8,7 @@ transifex-client==0.14.2
selenium==3.141.0
twine==3.4.1
Pallets-Sphinx-Themes==1.2.3
+docutils==0.16
Sphinx==3.5.3
sphinx-issues==1.2.0
sphinx-jinja==1.1.1
diff --git a/searx/webapp.py b/searx/webapp.py
index 4c09f0ac6..072f140ca 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -1133,11 +1133,14 @@ class ReverseProxyPathFix:
base_url = urlparse(settings['server']['base_url'])
self.script_name = base_url.path
+ if self.script_name.endswith('/'):
+ # remove trailing slash to avoid infinite redirect on the index
+ # see https://github.com/searx/searx/issues/2729
+ self.script_name = self.script_name[:-1]
self.scheme = base_url.scheme
self.server = base_url.netloc
def __call__(self, environ, start_response):
-
script_name = self.script_name or environ.get('HTTP_X_SCRIPT_NAME', '')
if script_name:
environ['SCRIPT_NAME'] = script_name