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

superagent fails with "Origin is not allowed by Access-Control-Allow-Origin" #863

Closed
jmound opened this issue Apr 15, 2015 · 2 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jmound
Copy link

jmound commented Apr 15, 2015

I'm unable to perform a simple GET via superagent:

var request = require('superagent');
    request
      .get('http://www.google.com/')
      .end(function(err, res){
        if (res) {
               console.log('yay got ' + err  );
             } else {
               console.log('Oh no! error ' + err );
             }
           });

yields:

2015-04-15 11:53:58.174 [tid:com.facebook.React.JavaScript] "Oh no! error Error: Origin is not allowed by Access-Control-Allow-Origin"

I've performed this making requests to a server running nginx that I control, with a variety of HTTP header permutations, and the note regarding CORS on superagent's docs here, with no success.

@jmound
Copy link
Author

jmound commented Apr 15, 2015

I came across this (slightly) related StackOverflow question and answer, and decided to reset the simulator on a whim. It shouldn't have, but it worked.

@jmound jmound closed this as completed Apr 15, 2015
@ide
Copy link
Contributor

ide commented Aug 24, 2015

You may have been developing with the Chrome debugger or UIWebView debugger which enforce CORS, so resetting the simulator state may have reset that :)

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
ayushjainrksh pushed a commit to MLH-Fellowship/react-native that referenced this issue Jul 2, 2020
* Fix facebook#863 - broken link in Images guide

* Fix facebook#863 - broken link in Images guide in 0.59 version

* Fix version-0.59/images id
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants