You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: playground/csp-violations/README.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -43,13 +43,27 @@ http://localhost:8080
43
43
44
44
The playground includes examples for different types of CSP violations:
45
45
46
+
### Basic CSP Violations
47
+
46
48
1.**Inline Script Violation** - Tests violations of inline scripts
47
49
2.**External Script Violation** - Tests loading scripts from non-allowed domains
48
50
3.**External Image Violation** - Tests loading images from non-allowed domains
49
51
4.**External Style Violation** - Tests loading stylesheets from non-allowed domains
50
52
5.**XHR Violation** - Tests making XHR requests to non-allowed domains
51
53
6.**Eval Violation** - Tests scripts with `eval` present
52
54
55
+
### Report-To Debug Cases
56
+
57
+
These test cases are specifically designed to debug report-to directive issues and test the logging functionality added in [PR #32868](https://github.com/PostHog/posthog/pull/32868):
58
+
59
+
1.**Debug Enabled** - Tests CSP reports with `debug=true` parameter for verbose logging
60
+
2.**Invalid Content Type** - Tests CSP reports sent with incorrect content type to trigger error logging
61
+
3.**Report-URI Only** - Tests pages using only `report-uri` directive (no `report-to`)
62
+
4.**Report-To Only** - Tests pages using only `report-to` directive (no `report-uri`)
63
+
5.**Both Report Directives** - Tests pages using both `report-uri` and `report-to` directives
7.**Sampling Test** - Generates multiple violations rapidly with random query parameters and hashes to bypass URL-based sampling and test sampling behavior and logging
66
+
53
67
Each example will automatically trigger a CSP violation when the page loads, which will be reported to your configured CSP endpoint.
0 commit comments