refactor(csp): expose strict and loose rule sets on CspConfig#11971
refactor(csp): expose strict and loose rule sets on CspConfig#11971sumukhswamy wants to merge 2 commits into
Conversation
Always compute both strict and loose rule sets in the constructor and expose them as strictRules, looseRules, looseHeader, and buildStrictHeaderWithNonce(nonce). Startup-time behavior of rules and header is preserved. This enables consumers to choose between strict and loose CSP at request time without depending on the constructor-time enable/strict decision. Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit d032aea)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
Persistent review updated to latest commit d032aea |
❌ 4 Jest Test Failure(s)📄
|
Description
Always compute both strict and loose rule sets in the constructor and expose them as strictRules, looseRules, looseHeader, and buildStrictHeaderWithNonce(nonce). Startup-time behavior of rules and header is preserved.
This enables consumers to choose between strict and loose CSP at request time without depending on the constructor-time enable/strict decision.
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jestyarn test:jest_integration