简体   繁体   English

禁止的响应标头

[英]Forbidden response headers

I'm confused with forbidden response headers.我对禁止的响应标头感到困惑。 MDN says : MDN 说

A forbidden response header name is an HTTP header name (either Set-Cookie or Set-Cookie2 ) that cannot be modified programmatically.禁止响应 header 名称是 HTTP header 名称( Set-CookieSet-Cookie2 ),无法以编程方式修改。

But i surely can send cookie response manually.但我肯定可以手动发送 cookie 响应。 So what does the word programmatically mean in this context?那么在这种情况下,“程序化”这个词是什么意思?

That term comes from the Fetch specification, which concerns sending requests and accessing responses from a program in the browser.该术语来自Fetch规范,它涉及从浏览器中的程序发送请求和访问响应。 Programmatically just means doing something from a program.编程方式只是意味着从程序中做某事。

So, yes, your server can set the cookie to whatever it wants, but a Javascript program that receives that response will not be able to change the value of the header.所以,是的,您的服务器可以将 cookie 设置为任何它想要的值,但是接收该响应的 Javascript 程序将无法更改 header 的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM