mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-05 09:21:54 +02:00
Allowing ANDI images
This commit is contained in:
parent
ebbd329c98
commit
5cd5cd645a
2 changed files with 15 additions and 4 deletions
|
@ -357,9 +357,20 @@ CSP_FORM_ACTION = allowed_sources
|
|||
# strict CSP by allowing scripts to run from their domain
|
||||
# and inline with a nonce, as well as allowing connections back to their domain.
|
||||
# Note: If needed, we can embed chart.js instead of using the CDN
|
||||
CSP_SCRIPT_SRC_ELEM = ["'self'", "https://www.googletagmanager.com/", "https://cdn.jsdelivr.net/npm/chart.js"]
|
||||
CSP_CONNECT_SRC = ["'self'", "https://www.google-analytics.com/"]
|
||||
CSP_INCLUDE_NONCE_IN = ["script-src-elem"]
|
||||
CSP_DEFAULT_SRC = [
|
||||
"'self'",
|
||||
]
|
||||
CSP_STYLE_SRC = ["'self'", "https://www.ssa.gov", "'unsafe-inline'"]
|
||||
CSP_SCRIPT_SRC_ELEM = [
|
||||
"'self'",
|
||||
"https://www.googletagmanager.com/",
|
||||
"https://cdn.jsdelivr.net/npm/chart.js",
|
||||
"https://www.ssa.gov",
|
||||
"https://ajax.googleapis.com",
|
||||
]
|
||||
CSP_CONNECT_SRC = ["'self'", "https://www.google-analytics.com/", "https://www.ssa.gov"]
|
||||
CSP_INCLUDE_NONCE_IN = ["script-src-elem", "style-src"]
|
||||
CSP_IMG_SRC = ["'self'", "https://www.ssa.gov"]
|
||||
|
||||
# Cross-Origin Resource Sharing (CORS) configuration
|
||||
# Sets clients that allow access control to manage.get.gov
|
||||
|
|
|
@ -168,7 +168,7 @@ class ANDIMiddleware(MiddlewareMixin):
|
|||
response = self.get_response(request)
|
||||
return response
|
||||
|
||||
def process_view(self, request, view_func, view_args, view_kwargs):
|
||||
def process_template_view(self, request, view_func, view_args, view_kwargs):
|
||||
response = self.get_response(request)
|
||||
if "text/html" in response.get("Content-Type", ""):
|
||||
andi_script = """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue