diff options
| author | Bobby <[email protected]> | 2024-09-05 05:18:09 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2024-09-05 05:18:09 -0400 |
| commit | 5bfdb6ef76df1d0af7b93e0a03ed917e10fc5fb9 (patch) | |
| tree | 5a5079296b9d89fbfd3f6557f1d2b694ebef1680 /middleware | |
| parent | df00dbdef3178aeceb2b36debdce851339fa3f91 (diff) | |
| download | yugen-5bfdb6ef76df1d0af7b93e0a03ed917e10fc5fb9.tar.xz yugen-5bfdb6ef76df1d0af7b93e0a03ed917e10fc5fb9.zip | |
fix url and watch sub dub
Diffstat (limited to 'middleware')
| -rw-r--r-- | middleware/remove_slash.py | 6 |
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 |
