You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
4 years ago | |
---|---|---|
Assets | 4 years ago | |
CorsClient | 4 years ago | |
CorsServer | 4 years ago | |
.gitignore | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago |
README.md
CORS(跨域资源共享)学习项目
原理
客户端:浏览器请求时,请求头携带上 Origin 标签(只包含请求站点信息,不包含路径信息。比如 http://localhost:5002),一般由浏览器或请求程序自动判断是否跨域而自动设置,无需人工参与,但是为了方便测试等,也可以强制添加。
服务端 :asp.net core 设置CORS后,如果请求头携带有 Origin 标签,则在响应头中添加CORS标签()明确浏览器可以跨域。