Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwdeane/csp
Rudimentary Express app for checking CSP Headers.
https://github.com/jwdeane/csp
Last synced: 14 days ago
JSON representation
Rudimentary Express app for checking CSP Headers.
- Host: GitHub
- URL: https://github.com/jwdeane/csp
- Owner: jwdeane
- Created: 2019-05-20T10:22:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T15:01:29.000Z (about 2 years ago)
- Last Synced: 2024-06-12T13:07:10.644Z (7 months ago)
- Language: HTML
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CSP Checker
Rudimentary Express app for checking CSP Header.
## Setup
Run `npm install` to install dependencies.
## Experiment with CSP Directives
Add new CSP directives in `index.js`:
```javascript
csp({
directives: {
defaultSrc: ["'self'"]
// etc…
}
});
```Experiment by adding new ``, `<link href="…">`, inline `<script>`'s etc to the `index.html` file to see what is / isn't blocked by your CSP config.
See the [Helmet Docs](https://helmetjs.github.io/docs/csp/) for reference.
## Run
Debug by running `node index.js`.
Check the Network panel to inspect the CSP Response Header.
Any requests on the page that CSP _blocks_ will be logged to the Console.