From 2cfc4dda3279a6c8ba0e9ec5a30c7300b42e2c31 Mon Sep 17 00:00:00 2001 From: kritzl Date: Mon, 30 Oct 2023 16:42:29 +0100 Subject: [PATCH] remove slashes only at start & end of path --- mafiasi/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mafiasi/urls.py b/mafiasi/urls.py index 1ac24a5..efcd982 100644 --- a/mafiasi/urls.py +++ b/mafiasi/urls.py @@ -63,7 +63,7 @@ def handler500(request): def handler404(request, exception): try: apps.get_app_config("wiki") - path = str(request.path).replace("/", "", 2) + path = str(request.path).strip("/") if "/" in path: return HttpResponse("Page not found", status=404)