简体   繁体   English

如何处理“对预检请求的响应未通过没有访问控制允许来源 header 存在于请求的资源上”来自 angular

[英]How to handle “Response to preflight request doesn't pass No Access-control-Allow-Origin header is present on requested resource ” from angular in BE

I'm sending this request from Angular UI:我从 Angular UI 发送这个请求:

'Accept':'multipart/form-data',
'Access-Control-Allow-Crendentails':'true',
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Method':'POST,GET,OPTIONS,PUT',
'Access-Control-Allow-Headers':'Authorization,Content-Type'

Iv'e got the following error:我有以下错误:

Orgin'http://localhost ' is therefore not allowed

The webserver is Apache Tomcat.网络服务器是 Apache Tomcat。 How can I handle this error?我该如何处理这个错误?

Please go through the following two links to solve your problem:请go通过以下两个链接解决您的问题:

  1. Set CORS header in Tomcat 在 Tomcat 中设置 CORS header
  2. How to enable CORS in apache tomcat 如何在 apache tomcat 中启用 CORS

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对预检请求的响应未通过访问控制检查:不存在“Access-Control-Allow-Origin”标头 - Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present 对预检请求的响应未通过访问控制检查:不存在“Access-Control-Allow-Origin”标头。 服务器错误 - Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present . Server error 如何修复对预检请求的响应未通过访问控制检查:否'Access-Control-Allow-Origin'? - How to fix Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'? Angular http post请求 - 请求的资源上不存在“Access-Control-Allow-Origin”标头 - Angular http post request - No 'Access-Control-Allow-Origin' header is present on the requested resource 尽管存在请求的资源,但没有“ Access-Control-Allow-Origin”标头存在 - No 'Access-Control-Allow-Origin' header is present on the requested resource despite it is there 请求的资源上不存在Access-Control-Allow-Origin标头 - No Access-Control-Allow-Origin header is present on the requested resource 请求的资源 (Ingress) 上不存在“Access-Control-Allow-Origin”标头 - No 'Access-Control-Allow-Origin' header is present on the requested resource (Ingress) 预检请求未通过访问控制检查:否 'Access-Control-Allow-Origin' - preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' 发送删除请求时,请求的资源上不存在“Access-Control-Allow-Origin”header - No 'Access-Control-Allow-Origin' header is present on the requested resource when sending delete request angular 9 和 spring 启动 2 中请求的资源上不存在“访问控制允许来源”header - No 'Access-Control-Allow-Origin' header is present on the requested resource in angular 9 and spring boot 2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM