0
There has been an error processing your request
Warning: Undefined array key "policy_id"
in /vendor/magento/module-csp/Model/Collector/ConfigCollector.php on line 111

What is the issue?

0

1 Answer 1

0

It seems a CSP rule (policy) has been defined in your custom module without specifying the policy ID. Please review all CSP rules defined in your custom module or check the error stack trace to identify the problematic module.

Here's a sample code snippet for defining a CSP (Content Security Policy) in a custom Magento 2 module:

<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
    <policies>
        <policy id="script-src">
            <values>
                <value id="devdocs-base" type="host">https://developer.adobe.com</value>
                <value id="magento" type="host">https://magento.com</value>
            </values>
        </policy>
        <policy id="connect-src">
            <values>
                <value id="devdocs" type="host">https://developer.adobe.com</value>
            </values>
        </policy>
    </policies>
</csp_whitelist>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.