Strip CSP headers on POS pages - #503
Conversation
…erence Security plugins like LiteSpeed Cache set Content-Security-Policy headers that block the POS from loading JS/CSS bundles from cdn.jsdelivr.net. Removes CSP and CSP-Report-Only headers before rendering any POS template. Adds woocommerce_pos_content_security_policy filter for custom policies.
📝 WalkthroughWalkthroughA new private method is introduced to the POS Template Router that cleans Content-Security-Policy headers before loading POS templates. The method removes existing CSP headers and applies a filter allowing custom CSP policies to be set during POS endpoint template redirection. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
Summary
cdn.jsdelivr.netContent-Security-PolicyandContent-Security-Policy-Report-Onlyheaders before rendering any POS templateX-Frame-Optionsremoval inInit.phpwoocommerce_pos_content_security_policyfilter for users who want to set a custom policyTest plan
script-src 'self'; style-src 'self' 'unsafe-inline')Content-Security-Policyheader is present on POS pages🤖 Generated with Claude Code
Summary by CodeRabbit