Community Abyss Alpha Coders Discussions Cross Origin Resource Sharing

Cross Origin Resource Sharing


Can a wildcard be added to the `Access-Control-Allow-Origin` response header?

 

This way we can use the API from the client side of the browser.  Otherwise this error is encountered:

Access to fetch at 'https://wall.alphacoders.com/api2.0/get.php?auth=APIKEYHERE&method=search&term=sunny' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
By scottcanoni 4 years ago

As stated in the documentation our API is only accesible via GET requests, we have no plan to make it accessible via POST requests.

By cdd 4 years ago

I wasn't asking for POST requests.

What do you think about adding a wildcard for the `Access-Control-Allow-Origin` response header?  To the GET request.

By scottcanoni 3 years ago

Sorry for the confusion. We have added this🙂

By Phaethon 3 years ago

Awesome thanks!  Unfortunately I have moved onto another project but I hope to return to this and I am excited you made this change, thank you!

By scottcanoni 3 years ago


Login To Reply