CORS error
-
Hello,
I set up this plugin for the backend and SPA with React for the front, and get an error below when I call an endpoint from the frontend; When I call the endpoint via Postman or Curl, it works with no error. I modified Access-Control-Allow-Origin value to * in class-wp-headless-rest-api-cors.php, http.php and rest-api.php but it produces the same error. Any advice would be grateful.Access to fetch at ‘https://mydomain/wp-json/wp/v2/posts/7’ 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.
The topic ‘CORS error’ is closed to new replies.