Open Jakhotiya opened 1 month ago
Hi @Jakhotiya. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Preconditions and environment
Steps to reproduce
Expected result
Domains listed in your custom csp_whitelist.xml under theme should have reflected on frontend
Actual result
If admin is hit first after cache flush, domains under your csp_whitelist.xml under theme are not seen on frontend.
Additional information
This bug happens because contents of csp_whitelist.xml in theme are stored in global cache. Lets see how this works right now. CSP cache is maintained area wise. For example, you will find 3 files in your cache
Now the bug happens because of
app/code/Magento/Csp/Model/Collector/CspWhitelistXml/FileResolver.php
if ($scope === 'global')
leads to csp_whitelist config in theme being put in global cache. After cache flush if admin request lands on server, $theme variable is set to Magento/backend . In this case, your file in frontend theme wont be read. Global cache is then populated according to Magento/backendThe behavior completely depends on which area request lands first, frontend or admin. This leads to poor developer experience too.
Release note
No response
Triage and priority