简体   繁体   English

XAMPP 服务器已被 CORS 策略阻止:

[英]XAMPP Server has been blocked by CORS policy:

Hello I have been dealing with this problem since 10 am, about 10 hours have passed but still could not fix the problem.您好,我从上午 10 点开始一直在处理这个问题,大约 10 个小时过去了,但仍然无法解决问题。 I am constantly trying to fix this problem.我一直在努力解决这个问题。

Problem Image / https://i.hizliresim.com/AtfbH9.png
The methods I'm trying to solve / https://i.hizliresim.com/SpWBzn.png)
The methods I'm trying to solve / https://i.hizliresim.com/ioZr55.png)

i am using XAMPP.我正在使用 XAMPP。 Please help me with this.请帮我解决一下这个。 I'm having a nervous breakdown.我精神崩溃了。 I'll go crazy soon.我很快就会发疯 go 。

You are limiting your resource access to only http://mabbo.biz/ but accessing the resource from https://mabbo.biz/ , the two schemes don't match hence the CORS error, http and https are different. You are limiting your resource access to only http://mabbo.biz/ but accessing the resource from https://mabbo.biz/ , the two schemes don't match hence the CORS error, http and https are different.

Also, your wildcard * is being overwritten by your explicit one, or as MDN puts it.此外,您的通配符*被您的显式通配符覆盖,或者如 MDN 所说。

Access-Control-Allow-Origin specifies either a single origin, which tells browsers to allow that origin to access the resource; Access-Control-Allow-Origin 指定单一来源,它告诉浏览器允许该来源访问资源; or else — for requests without credentials — the "*" wildcard, to tell browsers to allow any origin to access the resource.或者——对于没有凭据的请求——“*”通配符,告诉浏览器允许任何来源访问资源。

So since you have the http://mabbo.biz/ origin specified, any other origin will be rejected.因此,由于您指定了http://mabbo.biz/来源,任何其他来源都将被拒绝。

You could add a check to allow wildcard's on specific URLs or specific resource types, like .jpg|.png|.gif .您可以添加一个检查以允许在特定 URL 或特定资源类型上使用通配符,例如.jpg|.png|.gif

How that will be accomplished will differ from server to server though, so you'll have to look up how your server handles that check.但是,如何完成这将因服务器而异,因此您必须查看您的服务器如何处理该检查。

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

相关问题 ReactJS-PHP GET请求已被CORS策略阻止 - ReactJS - PHP GET Request has been blocked by CORS policy 已被 CORS 政策阻止:无“访问控制允许来源” - has been blocked by CORS policy: No 'Access-Control-Allow-Origin' 如何解决问题 Axios:已被 CORS 政策阻止: - how to fix the problem Axios : has been blocked by CORS policy: Laravel 从源访问 XMLHttpRequest 已被 CORS 策略阻止 - Laravel Access to XMLHttpRequest at from origin has been blocked by CORS policy 获取 wp_mail 已被 CORS 策略阻止 - Fetching wp_mail has been blocked by CORS policy 访问 abcd.com 上的字体已被 CORS 政策阻止:没有“访问控制允许来源” - Access to Font at abcd.com has been blocked by CORS policy: No 'Access-Control-Allow-Origin' PHP-CORS策略已阻止对字体的访问:没有“ Access-Control-Allow-Origin”标头 - PHP - Access to Font has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header 来自'http:// localhost / api from origin'http:// localhost:8000'的XMLHttpRequest访问已被CORS策略阻止 - Access to XMLHttpRequest at 'http://localhost/api from origin 'http://localhost:8000' has been blocked by CORS policy 通过axios requert调用php文件已被VUE CLI 3中的CORS策略阻止 - Call php file via axios requert has been blocked by CORS policy in VUE CLI 3 Flutter - XMLHttpRequest 已被 CORS 政策阻止 - Flutter - XMLHttpRequest has been bloked by CORS policy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM