Log in
Model

CspWhitelistXmlCollector

Magento\Csp\Model\Collector\CspWhitelistXmlCollector

What it does

This class collects Content Security Policy (CSP) rules defined in csp_whitelist.xml configuration files across Magento modules.

Developers use this when they need to whitelist specific hosts or hashes for CSP directives, allowing external resources like scripts, styles, or images to load on their store.

The collector reads XML configurations and converts them into FetchPolicy objects that Magento's CSP system can enforce.

Public Methods

  • collect()