如何从内容安全策略标题中隐藏允许的域?

问题描述 投票:-1回答:1

我试图隐藏(而不是删除)CSP(Content-Security-Policy)标头中的域如果删除它们,CSP将阻止来自它们的请求,我需要隐藏它们,以使用户无法在F12 netowrk窗口中看到域,这可能吗?

    <httpProtocol>
 <customHeaders>
  <add name="Content-Security-Policy"
 value="default-src 'self' https://google.com/; style-src 'self' 
'unsafe-inline' https://google.com/; font-src 'self' 
data: https://google.com/; script-src 'self' 
https://google.com/ 'unsafe-eval'; object-src 
'self' https://google.com/" /> 
  </customHeaders>
  </httpProtocol>
c# asp.net content-security-policy
1个回答
0
投票

标头(无论是HTTP还是HTML Meta)都需要发送。如果已发送,则可以读取。所以不,这是不可能的。唯一的选择是设置一个非常宽松的策略,该策略允许任何操作(我不建议这样做)。

© www.soinside.com 2019 - 2024. All rights reserved.