Commit 5bae8c2
Add tests and security documentation for CSP nonce support
- Add TypeScript tests for:
- buildConsoleReplay() with nonce parameter
- consoleReplay() returns JS without script tags
- Empty string handling with nonce
- Add security comments explaining:
- Why html_safe is safe (content pre-sanitized via scriptSanitizedVal)
- CSP nonce availability (Rails 5.2+)
- Add blank line before wrap_console_script_with_nonce method for consistency
All tests passing (100 passed in react-on-rails, 30 passed in pro).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 19aa8b7 commit 5bae8c2
File tree
2 files changed
+37
-1
lines changed- lib/react_on_rails
- packages/react-on-rails/tests
2 files changed
+37
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
440 | 443 | | |
441 | 444 | | |
442 | 445 | | |
443 | | - | |
| 446 | + | |
444 | 447 | | |
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
| 453 | + | |
450 | 454 | | |
451 | 455 | | |
452 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
78 | 110 | | |
0 commit comments