Created
September 23, 2019 09:08
-
-
Save balvinder294/332af9a291dee9ff7a6caeaea391a5eb to your computer and use it in GitHub Desktop.
Sample for Content Security Policy(CSP) in JHipster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************ | |
Content Security policy Jhipster | |
**********/ | |
/* Use directives as per your requirement like image-src and default-src for defaults of all*/ | |
// Single line CSP | |
.headers() | |
.contentSecurityPolicy("default-src 'self';") | |
// Multi Line CSP joined by and | |
.headers() | |
.contentSecurityPolicy("default-src 'self';") | |
.and() | |
.contentSecurityPolicy("script-src 'self' 'unsafe-eval' 'unsafe-inline' https://www.gstatic.com https://www.google.com http://www.google-analytics.com https://maps.googleapis.com https://storage.googleapis.com;") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment