This commit is contained in:
retoor 2025-06-06 03:41:06 +02:00
parent 9a39bedd3a
commit 3b38e30df1

View File

@ -24,6 +24,7 @@ def generate_nonce():
@web.middleware
async def csp_middleware(request, handler):
return response
response = await handler(request)
nonce = generate_nonce()
response.headers['Content-Security-Policy'] = csp_policy.format(nonce=nonce)