-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
CORS request blocked in Firefox but not other browsers #2803
Comments
@7hibault How did you pass your aws credentials to the Amplify library? |
@powerful23 I have a config file with the aws credentials and then
I manage to successfully call other endpoints from the app using this configuration |
@7hibault the |
@powerful23 Yes, I'm ensuring that the user is signed in at this point. If the user isn't signed in, they get redirected to a login page. Could you elaborate on why you think this could come from the configuration? I don't think this is the issue:
|
This drove me crazy but I think I figured it out... Turns out my browser was caching an incorrect preflight response. I didn't figure this out right away because the behavior was the same in private mode. I deactivated my addons one by one and after deactivating Ghostery, the request went through. @powerful23 Thanks for investigating 😃 |
In my case, the Privacy Badger extension was blocking subdomains, which triggered a CORS error. There's no need to remove this extension, though - just click on the Privacy Badger icon and slide any relevant "potential tracker" settings from blocked to allowed. |
In my case its firefox new feature "Enchanced tracking protection" caused the issue and by disabling that options, cors started working. |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
I'm using aws-amplify to query API Gateway (configured through serverless) to trigger a lambda.
I have no trouble accessing some resources except for one, which I get using query string parameters. This is the only difference with the other queries. Yet, I get CORS error and cannot see any log for the lambda that should have been triggered nor can I see the query in the browser network console.
What confuses me is that I get this error only in firefox and not in chrome.
In my serverless configuration file for the endpoint, I do have cors to true:
I configured the custom authorizer
In my lambda, I'm adding CORS headers before response
All of this is working well except for that one request with query string parameters, for which there's a CORS error logged in the console, but not log in network and no log in CloudWatch.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://...?x=1&y=2&z=3. (Reason: CORS request did not succeed).[Learn More]
What makes it even harder for me to understand is that when I remove my parameters, I get a 502 error from the lambda (as should be) and can read what's wrong in CloudWatch logs
Another thing that puzzles me is that this worked for a while and then stopped without me changing anything (except uploading a front-end to S3 and CloudFront but I fail to see where that could do something). I thought this might be caching issue but when I go to API Gateway > Stages > myStage, "Enable API cache" is not checked.
I'm really confused and would appreciate any help. Thank you.
The text was updated successfully, but these errors were encountered: