[英]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.