Reputation: 26134
If I receive this error when making a call to a third-party API service...
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
... is this something that the third-party needs to allow, as opposed to something I need to change with my request?
Upvotes: 1
Views: 1292
Reputation: 5954
Yes this header needs to be included in the response from server. (Not in your request.)
To allow any resource to access your resource, you can specify:
Access-Control-Allow-Origin: *
To allow
https://developer.mozilla.org
to access your resource, you can specify:
Access-Control-Allow-Origin: https://developer.mozilla.org
Upvotes: 3