简体   繁体   中英

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. 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. Please help me with this. I'm having a nervous breakdown. I'll go crazy soon.

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.

Access-Control-Allow-Origin specifies either a single origin, which tells browsers to allow that origin to access the resource; 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.

You could add a check to allow wildcard's on specific URLs or specific resource types, like .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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM