aboutsummaryrefslogtreecommitdiff
path: root/middleware
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-09-05 05:18:09 -0400
committerBobby <[email protected]>2024-09-05 05:18:09 -0400
commit5bfdb6ef76df1d0af7b93e0a03ed917e10fc5fb9 (patch)
tree5a5079296b9d89fbfd3f6557f1d2b694ebef1680 /middleware
parentdf00dbdef3178aeceb2b36debdce851339fa3f91 (diff)
downloadyugen-5bfdb6ef76df1d0af7b93e0a03ed917e10fc5fb9.tar.xz
yugen-5bfdb6ef76df1d0af7b93e0a03ed917e10fc5fb9.zip
fix url and watch sub dub
Diffstat (limited to 'middleware')
-rw-r--r--middleware/remove_slash.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/middleware/remove_slash.py b/middleware/remove_slash.py
index 15be769..0fde6c0 100644
--- a/middleware/remove_slash.py
+++ b/middleware/remove_slash.py
@@ -5,6 +5,10 @@ class RemoveSlashMiddleware:
self.get_response = get_response
def __call__(self, request):
- if request.path != '/' and request.path.endswith('/'):
+ if '/admin' in request.path and not request.path.endswith('/'):
+ return HttpResponsePermanentRedirect(request.path + '/')
+
+ if request.path != '/' and request.path.endswith('/') and "/admin/" not in request.path:
return HttpResponsePermanentRedirect(request.path[:-1])
+
return self.get_response(request) \ No newline at end of file