Commit a65c757
Nonce app-level inline scripts in Pro dummy demo pages
Codex review flagged that with the strict CSP enforced globally, demo
pages emitting their own inline scripts outside the React on Rails
helpers would be blocked: the Apollo examples' apolloStateTag and React
Router's StaticRouterProvider hydration-data script. Thread
railsContext.cspNonce into those script tags (StaticRouterProvider has a
first-class nonce prop). Verified on /react_router in a real browser:
zero securitypolicyviolation events and the hydration-data script
carries the per-request nonce.
These edits also document the recommended pattern for app-level inline
scripts under the strict policy (see docs/pro/strict-csp.md).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 26c20d7 commit a65c757
3 files changed
Lines changed: 13 additions & 3 deletions
File tree
- react_on_rails_pro/spec/dummy/client/app/ror-auto-load-components
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
0 commit comments