Access to fetch at 'https://some-amazon-aws-url.com/data/search' from
origin 'https://my-local-url.com:9898' 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.
I'm trying to use the aws4fetch library https://github.com/mhart/aws4fetch to include the AWS accessKeyId, secretAccessKey to the authorization header but I get the above error.
Oddly, when I simply use axios to make a request to that resource (without including any of the AWS auth info), I get the expected response (200) but when I try to use the aws4fetch library, I get the above error citing a CORS issue.
When I look at API-Gateway, I see my-local-url in the Access-Control-Allow-Origin list. Not sure why when I try using the including aws-auth info to the header, that cors error appears.
Comments
Post a Comment