I'm trying to add custom CSP as given in the link: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/container_csp.htm
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="./manifest.json">
<title>Title Page</title>
</head>
<body>
<div id="root">Only Element</div>
</body>
</html>
manifest.json
{
"landing-pages": [{
"path": "index.html",
"content-security-policy-type": "custom",
"content-security-policy": "style-src 'self' css.example.com"
}]
}
But I dont see the "content-security-policy" value is being added to the "Content-Security-Policy" on the response header.
Am I doing something wrong??
Thanks in advance.
Response Header:
Content-Security-Policy: default-src 'self'; script-src 'self' chrome-extension: 'unsafe-inline' 'unsafe-eval' https://sfdc.azureedge.net *.visualforce.com 'unsafe-eval' https://ssl.gstatic.com/accessibility/ 'nonce-6ae728d72555f715d4cbf040190e3a1382b5b0f3462247217bf8dcb58faaa7a5'; object-src 'self' https://my-domain-ed.documentforce.com; style-src 'self' chrome-extension: 'unsafe-inline' https://cdn.plyr.io https://s3.amazonaws.com https://my-dev-ed.lightning.force.com https://my--domain.visualforce.com https://my-domain-ed.documentforce.com https://my-dev-ed.my.salesforce.com https://my--domain.container.lightning.com https://www.youtube.com *.visualforce.com; img-src 'self' http: https: data: blob: https://cdn.plyr.io https://s3.amazonaws.com https://my-dev-ed.lightning.force.com https://my--domain.visualforce.com https://my-domain-ed.documentforce.com https://my-dev-ed.my.salesforce.com https://my--domain.container.lightning.com https://www.youtube.com *.visualforce.com; media-src 'self' https://cdn.plyr.io https://s3.amazonaws.com https://my-dev-ed.lightning.force.com https://my--domain.visualforce.com https://my-domain-ed.documentforce.com https://my-dev-ed.my.salesforce.com https://my--domain.container.lightning.com https://www.youtube.com *.visualforce.com https://my-domain-ed.documentforce.com; frame-ancestors https://my-dev-ed.lightning.force.com; frame-src https: mailto: https://cdn.plyr.io https://s3.amazonaws.com https://my-dev-ed.lightning.force.com https://my--domain.visualforce.com https://my-domain-ed.documentforce.com https://my-dev-ed.my.salesforce.com https://my--domain.container.lightning.com https://www.youtube.com *.visualforce.com; font-src 'self' https: data: https://cdn.plyr.io https://s3.amazonaws.com https://my-dev-ed.lightning.force.com https://my--domain.visualforce.com https://my-domain-ed.documentforce.com https://my-dev-ed.my.salesforce.com https://my--domain.container.lightning.com https://www.youtube.com *.visualforce.com; connect-src 'self' https://api.bluetail.salesforce.com https://staging.bluetail.salesforce.com https://preprod.bluetail.salesforce.com https://cdn.plyr.io https://s3.amazonaws.com https://my-dev-ed.lightning.force.com https://my--domain.visualforce.com https://my-domain-ed.documentforce.com https://my-dev-ed.my.salesforce.com https://my--domain.container.lightning.com https://www.youtube.com *.visualforce.com; report-uri /_/csp
I'm using this from a lightning component as below:
<lightning:container src="{!$Resource.Container + '/index.html'}" onmessage="{!c.handleMessage}" onerror="{!c.handleError}" />