Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting CORS error when trying to consume the sandbox URL from a S3 bucket #24

Open
mralebrije opened this issue Nov 29, 2022 · 0 comments

Comments

@mralebrije
Copy link

I have an FE app in Angular which is consuming the Amazon Hub Counter API.

In order to make tests over the sandbox URL of the Amazon Hub Counter API (https://accesspoints-api-sandbox-na.amazon.com/v1) I deployed my FE to a S3 bucket, the app is working fine, but when I try to consume any endpoint from the sandbox URL I'm getting the following CORS error:

image

image

As you can see the GET token endpoint is passing successfully since this endpoint lives in a different url (https://api.amazon.com/auth/o2/token) but any request to the sandbox URL is failing due to this CORS error.

Any ideas how to solve this?

BTW, this error is not happening if I test the Angular app running locally, I mean, when the FE is deployed to localhost:4200, in this way the sandbox URL is respoding correctly. Could it be an issue of how the sandbox server is configured? I mean is this only accepting requests from localhost? Also when using POSTMAN the requests are passing successfully, the only problem comes when I try to consume from an external S3 bucket ex. http://counter-staging.s3-website.us-east-2.amazonaws.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant