I have two web sites:
https://exampleiframe.com
(third-party website),
https://example.com
(my website)
I want to restrict https://example.com
to load only inside iframe of https://exampleiframe.com
I have added ??? below CSP in the response header for https://example.com
.
"Content-Security-Policy": "frame-ancestors 'self' https://exampleiframe.com"
This policy only restricts when the request is coming from an iframe. But I don't want to load this url (https://example.com
) anywhere other than this iframe.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…