rest - CORS - 从 Postman 伪造 CORS 预检无法返回 header

标签 rest http cors postman

如果我伪造来自 Postman 的 OPTIONS 预检 CORS 请求,我不会从我的 API 返回 CORS header 。

最佳答案

在对 Microsoft.Owin.Cors 库进行完全逆向工程后,我发现 header 不在请求中!

这让我从 Postman 文档中发现了这个美丽的地方:

Restricted headers and cookies

Unfortunately some headers are restricted by Chrome and the XMLHttpRequest specification. The following headers are blocked:

Accept-Charset Accept-Encoding Access-Control-Request-Headers Access-Control-Request-Method Connection Content-Length Cookie Cookie 2 Content-Transfer-Encoding Date Expect Host Keep-Alive Origin Referer TE Trailer Transfer-Encoding Upgrade User-Agent Via

https://www.getpostman.com/docs/requests

啊啊啊。那是我生命中再也回不去的一天。

关于rest - CORS - 从 Postman 伪造 CORS 预检无法返回 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34931193/

相关文章:

angularjs - 使用 Angular 2 和 Http 对象获取网页内容

Python 请求 HTTP 响应 406

asp.net - App_Start 中缺少 WebApiConfig.cs。我可以使用 Startup.cs 吗?

python - djangorest框架中django过滤器后端的条件?

使用 Eclipse 和 Jetty 的 Java RESTful Web 服务教程

java - 带有 javax.ws.rs.core.Application 的 MultiPartFeature

java - 通过 GlassFish 服务器使用 REST - 如何允许使用 HTML 输入更新列表并返回 JSON 对象?

python - 使用 Mechanize 在 wordpress 上发帖

javascript - CORS请求结构很难理解,你能帮忙解释一下吗?

来自 S3 CORS 的 AJAX GET 在预检选项上失败,出现 403