- Issue created by @brianperry
- Status changed to Closed: works as designed
about 1 year ago 6:42pm 4 December 2023 I can reproduce this with a codesandbox but I see a better error message when trying this locally with the example:
Access to fetch at 'https://dev-drupal-api-client-poc.pantheonsite.io/es/jsonapi/node/recipe...' from origin 'http://localhost:5173' 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
Looks like setting a custom header breaks the CORS? This one is beyond me a bit but I think the setting a custom header itself is working and this is a config issue one way or another. I'm going to mark this as closed.
This does highlight to me that we need better error handling throughout.