From b668f6d2fffa3133a5220d93b39d49ead0309da5 Mon Sep 17 00:00:00 2001 From: Bjarki Date: Tue, 6 Jul 2021 03:09:18 +0000 Subject: [PATCH] build(docs-infra): enable Trusted Types enforcement in angular.json (#42800) Configure angular.json to serve a CSP header that enabled Trusted Types in enforcement mode, both in e2e tests and when running the local development server. This should help prevent regressions related to Trusted Types in the angular.io app. PR Close #42800 --- aio/angular.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aio/angular.json b/aio/angular.json index 215aa49ea4a..c91e73d6255 100644 --- a/aio/angular.json +++ b/aio/angular.json @@ -138,6 +138,11 @@ }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "headers": { + "Content-Security-Policy": "require-trusted-types-for 'script'; trusted-types angular angular#bundler angular#unsafe-bypass aio#analytics google#safe" + } + }, "configurations": { "next": { "browserTarget": "site:build:next"