惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Spread Privacy
Spread Privacy
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
N
News | PayPal Newsroom
A
Arctic Wolf
NISL@THU
NISL@THU
W
WeLiveSecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
L
Lohrmann on Cybersecurity
Last Week in AI
Last Week in AI
T
Threatpost
The Last Watchdog
The Last Watchdog
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
S
Security Affairs
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
雷峰网
雷峰网
T
Tenable Blog
Schneier on Security
Schneier on Security
H
Heimdal Security Blog
V2EX - 技术
V2EX - 技术
V
V2EX
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Latest news
Latest news
Help Net Security
Help Net Security
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
V
Vulnerabilities – Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - shunliy

使用Aspose.Slides把ppt转换成pdf问题的解决,丢失文本和报IBM437字符集问题 ServiceStack在IIS7中发布后出现403.14错误 ORACLE 误删除数据恢复 Xamarin官方示例代码无法部署,提示已跳过部署解决方法 安装完Oracle之后的注意事项 在VS2013中使用水晶报表 ArcObjects10.0MapControl不显示地图内容 ArcObjects10.0引用控件报错 ArcGIS Desktop10.2与CityEngine2012兼容问题 Acess定义过多字段 Oracle解决导入CLOB大字段数据失败的问题 MVC中的几个问题汇总 SQL Network Interfaces error: 26 - 定位指定的服务器/实例时出错 远程登录问题 VS2010不能有System文件夹 删除重复数据 远程桌面不能拷贝文件 cannot load msptls.dll SQLServer中触发器不能批量插入
asp.net core 3.1 webapi 跨域解决办法
shunliy · 2020-04-24 · via 博客园 - shunliy

利用asp.net core 3.1 开发了一个webapi,部署在IIS时,出现如下错误:

Access to fetch at 'XXXXX' from origin 'http://xxxxxxx:xxxx' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.

在Startup.cs 的ConfigureServices和Configure都进行了跨域设置,具体的设置,微软官方文档说明的比较详细。

https://docs.microsoft.com/zh-cn/aspnet/core/security/cors?view=aspnetcore-3.1

部署在IIS依然有跨域问题,还是在上面微软官方文档里面找到了解决办法:需要安装IIS Cors跨域模块。

程序内部异常或错误也会报出跨域的问题。