feat: implement Fil-A-Management Django MVP
This commit is contained in:
commit
1127e7ecf4
66 files changed
+3774
No files matched your search
@@ -0,0 +1,18 @@
|
||||
from django.utils.cache import patch_cache_control
|
||||
|
||||
|
||||
class PrivatePageMiddleware:
|
||||
def __init__(self, get_response):
|
||||
self.get_response = get_response
|
||||
|
||||
def __call__(self, request):
|
||||
response = self.get_response(request)
|
||||
if not request.path.startswith("/static/"):
|
||||
patch_cache_control(response, private=True, no_store=True, max_age=0)
|
||||
if not request.path.startswith("/admin/"):
|
||||
response["Content-Security-Policy"] = (
|
||||
"default-src 'self'; script-src 'self'; style-src 'self'; "
|
||||
"img-src 'self' data:; object-src 'none'; base-uri 'self'; "
|
||||
"form-action 'self'; frame-ancestors 'none'"
|
||||
)
|
||||
return response
|
||||
Reference in new issue
Block a user