当前位置:网站首页>Request header field xxxx is not allowed by Access-Control-Allow-Headers in preflight response问题
Request header field xxxx is not allowed by Access-Control-Allow-Headers in preflight response问题
2022-06-10 18:06:00 【胡安民】
报错信息
这是因为目标服务不允许在请求头中加 x-run-as 这个
解决办法
第一种,前端请时候将请求头中的 x-run-as 这个去掉
第二种,后端跨域配置中的Access-Control-Allow-Headers请求头中添加这个key
//添加上x-run-as,不能使用*否则只会当做普通字符串
response.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token,x-run-as");


边栏推荐
- Ibox system development core functions and some core source codes
- VMware vCenter version number comparison table
- [QNX hypervisor 2.2 user manual] 3.2.3 ACPI table and FDT
- [database] differences among structured data, unstructured data and semi-structured data
- c语言---6 初识选择语句、循环语句、函数以及数组
- 换根呀呀啊呀
- c语言---5 初识字符串、转义字符、注释
- AOE network critical path
- 5. Golang泛型与反射
- c语言学习回顾---1 基础知识回顾
猜你喜欢

Data URL

The question of enterprise managers, where have we spent our money after so many years of informatization?

如何设置 SaleSmartly 以进行 Google Analytics(分析)跟踪

c语言---9 初识宏、指针

Form form of the uniapp uview framework, input the verification mobile number and verification micro signal

ETL的使用过程中遇到的坑(ETL中文乱码)
![[CEPH] CEPH configuration source code analysis | common/config*](/img/d6/ba8d3ccc28d11e7fd9662b730fd998.jpg)
[CEPH] CEPH configuration source code analysis | common/config*

Faster Planner——Kinodynamic Astar详解

VMware ESXi 各版本号对照表

Wechat applet, get the current page and judge whether the current page is a tabbar page
随机推荐
华为云鲲鹏DevKit代码迁移实战
[Interface tutorial] how does easycvr set platform cascading through the interface?
"Digital transformation, data first", talk about how important data governance is to enterprises
阅读micropyton源码-添加C扩展类模块(2)
LoRa模块无线收发通信技术详解
ADS,AXD基本使用说明
一道题讲解动态规划的前世今生
c语言学习回顾---1 基础知识回顾
Step on the pit. The BigDecimal was improperly used, resulting in P0 accident!
3. Golang并发入门
Real time business intelligence Bi (II): reasonable ETL architecture design to realize quasi real time Business Intelligence BI
商业智能BI的服务对象,企业管理者的管理“欲望”该如何实现?
元数据管理,数字化时代企业的基础建设
作为程序员,对于底层原理真的有那么重要吗?
数据可视化入门学习,要警惕陷阱误区,把握关键节点
【QNX Hypervisor 2.2 用户手册】3.2.3 ACPI表和FDT
Aesthetic experience (episode 237) Luo Guozheng
[database] differences among structured data, unstructured data and semi-structured data
商业智能BI的价值,可视化报表等于商业智能BI吗?
The value of Bi in the enterprise: business analysis and development decision