Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从内容安全策略头中隐藏允许的域?_C#_Asp.net_Content Security Policy - Fatal编程技术网

C# 如何从内容安全策略头中隐藏允许的域?

C# 如何从内容安全策略头中隐藏允许的域?,c#,asp.net,content-security-policy,C#,Asp.net,Content Security Policy,我试图从CSP(内容安全策略)头中隐藏(而不是删除)域 如果我删除它们,CSP将阻止来自它们的请求,我需要隐藏它们,以便用户无法在F12 netowrk窗口看到域,是否可能 <httpProtocol> <customHeaders> <add name="Content-Security-Policy" value="default-src 'self' https://google.com/; style-src 'self' 'unsafe-

我试图从CSP(内容安全策略)头中隐藏(而不是删除)域 如果我删除它们,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>


需要发送标头(无论是HTTP还是HTML元数据)。如果已发送,则可以读取。所以不,这是不可能的。唯一的选择是制定一个非常宽松的政策,允许任何事情发生(我不建议这样做)。

不,不可能。他们要么存在,要么不存在。如果它们不存在,则已被移除。