.net6跨域设置

刚开始的设置

cs 复制代码
services.AddCors();
app.UseCors(builder => builder
    .AllowAnyOrigin()
    .AllowAnyMethod()
    .AllowAnyHeader()
    .AllowCredentials());

启动项目报错

The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time" error

修改代码去掉AllowCredentials

cs 复制代码
services.AddCors();
app.UseCors(builder => builder
    .AllowAnyOrigin()
    .AllowAnyMethod()
    .AllowAnyHeader()
    );
相关推荐
SEO-狼术36 分钟前
Red Gate .NET Developer Crack
.net
xiaopengbc43 分钟前
[Windows] 微软.Net运行库离线合集包 Microsoft .Net Packages AIO v13.05.25
windows·microsoft·.net
智者知已应修善业3 小时前
【c#窗体荔枝计算乘法,两数相乘】2022-10-6
经验分享·笔记·算法·c#·.net
时光追逐者6 小时前
C#拾遗补漏之 Dictionary 详解
开发语言·c#·.net·.net core
切糕师学AI1 天前
Spire.XLS for .NET 中, 将 Excel 转换为 PDF 时, 如何设置纸张大小为A4纸,并将excel内容分页放置?
pdf·.net·excel·spire
TLucas1 天前
Centos 7部署.NET 8网站项目
linux·nginx·postgresql·centos·.net
SEO-狼术1 天前
Aspose.Medical for .NET Crack
.net
一包烟电脑面前做一天1 天前
.Net + Qdrant 使用Microsoft.ML.OnnxRuntime调用本地大模型实现文本向量化,实现简单RAG
.net·onnx·rag·文本向量化·本地大模型·qdrant
喵叔哟2 天前
33.【.NET8 实战--孢子记账--从单体到微服务--转向微服务】--单体转微服务--财务服务--记账
微服务·架构·.net