aboutsummaryrefslogtreecommitdiff
path: root/middleware
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-08-12 10:10:53 -0400
committerBobby <[email protected]>2024-08-12 10:10:53 -0400
commit3eb61715ecfa0dcf90ee607661f8777e6765bab3 (patch)
tree2f6354edece99f2bae997353a66cf2128c233350 /middleware
parent4fac6e536e19626eee40845e337542c89cd26215 (diff)
downloadthatcomputerscientist-3eb61715ecfa0dcf90ee607661f8777e6765bab3.tar.xz
thatcomputerscientist-3eb61715ecfa0dcf90ee607661f8777e6765bab3.zip
update ignis to ignore anidata
Diffstat (limited to 'middleware')
-rw-r--r--middleware/ignismiddleware.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/middleware/ignismiddleware.py b/middleware/ignismiddleware.py
index 85c2c0e2..a764ce79 100644
--- a/middleware/ignismiddleware.py
+++ b/middleware/ignismiddleware.py
@@ -25,8 +25,14 @@ class IgnisMiddleware(MiddlewareMixin):
def __call__(self, request):
response = self.get_response(request)
- # id request is from localhost or 127.0.0.1, do not process
- if re.match(r"^localhost", request.get_host()) or re.match(r"^127.0.0.1", request.get_host()):
+ # if request is from localhost or 127.0.0.1, do not process
+ if re.match(r"^localhost", request.get_host()) or re.match(
+ r"^127.0.0.1", request.get_host()
+ ):
+ return response
+
+ # if request is made to /anidata or /admin, do not process
+ if re.match(r"^/anidata", request.path) or re.match(r"^/admin", request.path):
return response
# Do not process non-HTML responses