安全 header 如
x-content-type-options:nosniff
x-frame-options:SAMEORIGIN
x-ua-compatible:IE=edge, chrome=1
x-xss-protection:1; mode=block
应该是请求头还是响应头?为什么?
最佳答案
浏览器使用所有这些 header (如大多数 http 安全 header )来启用浏览器中的安全功能。
因此它们需要位于服务器发送到浏览器的响应 header 中。
将它们设置在请求 header (从浏览器发送到服务器)中不会执行任何操作,因为服务器不使用它们。
关于security - 安全 header 应该在哪里?响应 header 还是请求 header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36171924/