Skip to content

Commit ba19465

Browse files
authored
feat(nextjs): CSP reporting mode (#5702)
1 parent 1a23832 commit ba19465

File tree

5 files changed

+357
-279
lines changed

5 files changed

+357
-279
lines changed

.changeset/cool-roses-scream.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/backend': minor
3+
'@clerk/nextjs': minor
4+
---
5+
6+
Adding reportTo and reportOnly configuration options to the contentSecurityPolicy config for clerkMiddleware

packages/backend/src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const Headers = {
5050
CloudFrontForwardedProto: 'cloudfront-forwarded-proto',
5151
ContentType: 'content-type',
5252
ContentSecurityPolicy: 'content-security-policy',
53+
ContentSecurityPolicyReportOnly: 'content-security-policy-report-only',
5354
EnableDebug: 'x-clerk-debug',
5455
ForwardedHost: 'x-forwarded-host',
5556
ForwardedPort: 'x-forwarded-port',
@@ -61,6 +62,7 @@ const Headers = {
6162
Referrer: 'referer',
6263
SecFetchDest: 'sec-fetch-dest',
6364
UserAgent: 'user-agent',
65+
ReportingEndpoints: 'reporting-endpoints',
6466
} as const;
6567

6668
const ContentTypes = {

0 commit comments

Comments
 (0)