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

Request works in Chrome, fails in Firefox with "CORS request rejected" error #56

Closed
misterfresh opened this issue Oct 1, 2015 · 2 comments

Comments

@misterfresh
Copy link

In Chrome the following code works.
In Firefox I get the error :
Error: CORS request rejected
With the code :

use strict';
var request =require('browser-request');
var url = 'http://docs.google.com/spreadsheets/export?id=1-on_GfmvaEcOk7HcWfKb8B6KFRv166RkLN2YmDEtDn4&exportFormat=csv';
request(url, function (error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log('success fetch');
        console.log(response.statusCode);
        console.log(body);
    }else{
        console.log(error + ' ' + response.statusCode );
    }
});
@pietercolpaert
Copy link

pebcak ;) http://enable-cors.org/

@misterfresh
Copy link
Author

Yes. Actually I tried with jquery ajax and had exactly the same issue. So it's not a browser-request problem. http://stackoverflow.com/questions/32897921/why-does-this-cors-request-to-a-google-drive-sheet-fail-in-firefox-works-in-c

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

2 participants