fix: mise à jour settings pour la prod / correction CORS

This commit is contained in:
N3WT DE COMPET
2025-05-31 17:16:32 +02:00
parent 017c0290dd
commit 25e2799c0f
3 changed files with 34 additions and 42 deletions

View File

@ -1,8 +1,11 @@
from django.conf import settings
class ContentSecurityPolicyMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
response['Content-Security-Policy'] = "frame-ancestors 'self' http://localhost:3000"
response['Content-Security-Policy'] = f"frame-ancestors 'self' {settings.BASE_URL}"
return response