mirror of
https://github.com/shadoll/scatcher.git
synced 2025-12-20 01:25:59 +00:00
Refactor namespace checking logic in base_controller.py
This commit is contained in:
@@ -9,7 +9,17 @@ class BaseController:
|
|||||||
"api",
|
"api",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
BLACK_LIST = [
|
||||||
|
".env",
|
||||||
|
"favicon.ico",
|
||||||
|
"robots.txt",
|
||||||
|
"wp-login.php",
|
||||||
|
".DS_Store",
|
||||||
|
]
|
||||||
|
|
||||||
def check_namespace(self, namespace: str) -> bool:
|
def check_namespace(self, namespace: str) -> bool:
|
||||||
if namespace in self.RESTRICTED_NAMESPACES:
|
if namespace in self.RESTRICTED_NAMESPACES:
|
||||||
return False
|
return False
|
||||||
|
if namespace in self.BLACK_LIST:
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user