Skip to content
Snippets Groups Projects
Commit 91fbd39c authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'django-csp-4' into 'master'

update to django-csp 4.0

See merge request !256
parents 32b068c4 07440fbd
No related branches found
No related tags found
1 merge request!256update to django-csp 4.0
Pipeline #153797 passed
...@@ -28,5 +28,5 @@ tqdm ...@@ -28,5 +28,5 @@ tqdm
gunicorn gunicorn
qrcode[pil] qrcode[pil]
python-magic # to check mime type python-magic # to check mime type
django-csp django-csp>=4.0
#END OF FILE #END OF FILE
...@@ -251,34 +251,37 @@ FILE_UPLOAD_MAX_MEMORY_SIZE = 10485760 # 10Mo ...@@ -251,34 +251,37 @@ FILE_UPLOAD_MAX_MEMORY_SIZE = 10485760 # 10Mo
################################################################################ ################################################################################
# DJANGO CSP, and DJANGO CSP REPORTS # DJANGO CSP, and DJANGO CSP REPORTS
################################################################################ ################################################################################
CSP_DEFAULT_SRC = [
"'self'", CONTENT_SECURITY_POLICY = {
"*", 'DIRECTIVES': {
] 'default-src': [
CSP_SCRIPT_SRC = [ "'self'",
"'self'", '*',
"cdn.datatables.net", ],
"cdnjs.cloudflare.com", 'script-src': [
"code.jquery.com", "'self'",
"plausible.pasteur.cloud", 'cdn.datatables.net',
"stackpath.bootstrapcdn.com", 'cdnjs.cloudflare.com',
"cdn.jsdelivr.net", 'code.jquery.com',
"www.googletagmanager.com", 'plausible.pasteur.cloud',
"www.google-analytics.com", 'stackpath.bootstrapcdn.com',
] 'cdn.jsdelivr.net',
CSP_STYLE_SRC = [ 'www.googletagmanager.com',
"'self'", 'www.google-analytics.com',
"'unsafe-inline'", ],
'*', 'style-src': [
] "'self'",
CSP_IMG_SRC = [ "'unsafe-inline'",
"'self'", '*',
"*", ],
"data:", 'img-src': [
] "'self'",
CSP_EXCLUDE_URL_PREFIXES = ( "*",
# "/candidate/", "data:",
) ],
CSP_REPORT_URI = reverse_lazy('cspmailreports:csp-report') 'report-uri': reverse_lazy('cspmailreports:csp-report'),
},
'EXCLUDE_URL_PREFIXES': (),
}
################################################################################ ################################################################################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment