Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pw/pw-csp/client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<html lang="en">
<head>
<!-- Enable CSP using <meta> -->
<meta
<!-- <meta
http-equiv="Content-Security-Policy"
content="default-src 'none'; script-src 'self'; img-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self'; font-src 'self';"
>
> -->

<meta charset="utf-8">
<title>Test</title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected void configure(HttpSecurity http) throws Exception {
;
// TODO uncomment this line to activate JWT filter

// setCspConfig(http);
setCspConfig(http);

}

Expand All @@ -116,34 +116,13 @@ private void setCspConfig(HttpSecurity http) throws Exception {
http
.headers()
.contentSecurityPolicy(
"script-src" +
" 'none' "+
// "'unsafe-eval' 'unsafe-inline' " +
";" +
// add connect-src directive to adapt CSP over cross-origin requests (CORS)
"connect-src"+
" 'self'"+
";"+
" style-src" +
" 'self' 'unsafe-inline'"+
";" +
" font-src" +
" 'self' "+
";" +
" img-src" +
" 'self' " +
";" +
" child-src" +
" 'self' " +
";" +
" object-src" +
" 'none' " +
";" +
" report-uri" +
" 'http://localhost:4200' " +
";" +
" default-src" +
" 'self' ");//.reportOnly();
"default-src 'none';" +
"connect-src 'self';" +
"font-src 'self';" +
"img-src 'self';" +
"style-src 'self' 'unsafe-inline';" +
"script-src 'self' 'unsafe-inline';");
//.reportOnly();
}

private JWTConfigurer securityConfigurerAdapter() {
Expand Down