We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

Create config.xml in your custom module and add below code
Vendor/Module/etc/config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <csp>
            <mode>
                <storefront>
                    <report_only>0</report_only>
                </storefront>
                <admin>
                    <report_only>0</report_only>
                </admin>
            </mode>
        </csp>
    </default>
</config>
Add a domain to the whitelist
Create csp_whitelist.xml in your custom module and add below code
Vendor/Module/etc/csp_whitelist.xml
<?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="cdn.jsdelivr.net" type="host">https://cdn.jsdelivr.net/</value>
            </values>
        </policy>
        <policy id="style-src">
            <values>
                <value id="fontawesome" type="host">https://fontawesome.com</value>
            </values>
        </policy>
        <policy id="img-src">
            <values>
                <value id="google.co.in" type="host">https://www.google.co.in/</value>
            </values>
        </policy>
        <policy id="connect-src">
            <values>
                <value id="ct.pinterest.com" type="host">https://ct.pinterest.com</value>
            </values>
        </policy>
        <policy id="font-src">
            <values>
                <value id="cloudflare" type="host">https://cloudflare.com</value>
            </values>
        </policy>
        <policy id="frame-src">
            <values>
                <value id="pinterest" type="host">https://pinterest.com</value>
            </values>
        </policy>
        <policy id="form-action">
            <values>
                <value id="pinterest.com" type="host">https://pinterest.com</value>
            </values>
        </policy>
    </policies>
</csp_whitelist>

 

Fill the below form if you have any Magento programming need.

    Recent Articles
    Get a Free Quote

      Let’s initiate a discussion!!