Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
docs(csp): remove if condition for CSP middleware (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
oioki authored Jan 22, 2024
1 parent 31fb51f commit 23290b0
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/docs/self-hosted/csp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ title: "Self-Hosted Content Security Policy (CSP)"
Starting with Sentry `23.5.0`, it is possible to enable the [CSP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) on self-hosted Sentry installations. The good news is that Sentry itself supports [collecting of CSP reports](https://docs.sentry.io/product/security-policy-reporting/). We recommend creating a separate Sentry project for CSP reports. To enable CSP and reports collection, you'll want to configure the following settings in `sentry.conf.py`:

```python
if "csp.middleware.CSPMiddleware" not in MIDDLEWARE:
MIDDLEWARE = ("csp.middleware.CSPMiddleware",) + MIDDLEWARE
CSP_REPORT_URI = "https://your-sentry-url-prefix.com/api/{csp-project-id}/security/?sentry_key={sentry-key}"
CSP_REPORT_ONLY = True
```
Expand Down

1 comment on commit 23290b0

@vercel
Copy link

@vercel vercel bot commented on 23290b0 Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

develop – ./

develop.sentry.dev
develop-git-master.sentry.dev

Please sign in to comment.