fix(security): resolve CSP syntax error and remove unreachable code - #990
fix(security): resolve CSP syntax error and remove unreachable code#990Chigael wants to merge 10 commits into
Conversation
|
@Chigael is attempting to deploy a commit to the csxark's projects Team on Vercel. A member of the Team first needs to authorize it. |
🎉 Thank You for Your ContributionHello @Chigael, Thank you for submitting a Pull Request to CryptoViz. We appreciate the time and effort you've invested in contributing to the project. Your Pull Request has been received successfully and will be reviewed by the maintainers as soon as possible. 📋 Pull Request Checklist
Ensuring these requirements are met helps streamline the review process and enables maintainers to review your contribution more efficiently. ❤️ Support CryptoVizIf you find CryptoViz helpful, consider supporting the project by:
Your support helps increase the project's visibility and encourages continued development. Thank you for being a part of the CryptoViz community! Thank you once again for contributing to CryptoViz. We appreciate your support and look forward to reviewing your contribution. |
|
Warning Review limit reached
Next review available in: 31 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe CSP security module now requires Web Crypto for nonce generation, detects actual whitespace in ChangesCSP validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/security/contentSecurityPolicy.ts`:
- Around line 131-134: Update the hasScriptNonce detection in the CSP validation
logic to recognize a nonce followed by additional script-src source expressions
such as strict-dynamic. Replace the directive-end requirement after the nonce
with a token boundary and allow the remaining directive values to be consumed,
while preserving matching across directive boundaries.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f29bdfc5-19ba-45ea-9df7-66f8b6507eb5
📒 Files selected for processing (3)
lib/offline/precacheRoutes.tslib/security/contentSecurityPolicy.tspublic/sw.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Hi @Chigael resolve the merge conflicts |
Updated the last generated timestamp in the precache routes manifest.
…b.com/Chigael/CryptoViz into fix/csp-syntax-error-unreachable-code
|
@csxark kindly reopen, so I can resolve conflict and then possible merge the PR |
Pull Request
Description
This PR fixes syntax errors and unclosed brace structures in lib/security/contentSecurityPolicy.ts that were causing TypeScript compilation failures (TS1005: '}' expected).
Related Issue
Closes #963
Type of Change
Changes Made
Testing
Screenshots
If applicable, attach screenshots or screen recordings.
Checklist
Additional Notes
Add any additional information for reviewers here.
Summary by CodeRabbit