Repair redirect to trailing slash.
authorBenjamin Braatz <bb@bbraatz.eu>
Tue, 10 Aug 2021 18:47:37 +0000 (20:47 +0200)
committerBenjamin Braatz <bb@bbraatz.eu>
Tue, 10 Aug 2021 18:47:37 +0000 (20:47 +0200)
controlpi_plugins/wsserver.py

index 981f7e2128a2605b071ac32580d6bee460cd544c..0ede4434abfc02ac62d968cb2e5c011822ba9da6 100644 (file)
@@ -152,7 +152,7 @@ class WSServer(BasePlugin):
                 relative_path = path[len(start_path):]
                 location = os.path.join(location_path, relative_path)
         if location:
-            if os.path.isdir(location) and not location.endswith('/'):
+            if os.path.isdir(location) and not path.endswith('/'):
                 status = http.HTTPStatus.MOVED_PERMANENTLY
                 response_headers['Location'] = path + '/'
             else: