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

CORs support broken in Dartium #15992

Closed
DartBot opened this issue Jan 9, 2014 · 2 comments
Closed

CORs support broken in Dartium #15992

DartBot opened this issue Jan 9, 2014 · 2 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jan 9, 2014

This issue was originally filed by matt...@chromium.org


What steps will reproduce the problem?
1.In a dart application, attempt to access a CORs enabled page on a seperate domain

Future<HttpRequest> request = HttpRequest.request(
       'http://labs.gauntface.co.uk/eisandnose/demofeed.rss'
      );
request.then((request) {
    if (request.readyState == HttpRequest.DONE &&
        (request.status == 200)) {
        onSuccess(request.responseText);
    } else if (request.readyState == HttpRequest.DONE) {
      onError(msg: 'An unknown error occured. Please try again.');
    }
  });
request.catchError((error) {
    print('catchError() value = error');
    onError();
});

2.Notice the following error message in the console:

XMLHttpRequest cannot load http://labs.gauntface.co.uk/eisandnose/demofeed.rss. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:3030' is therefore not allowed access.

What is the expected output? What do you see instead?
The request should go through without any issues.

If you load the URL 'http://labs.gauntface.co.uk/eisandnose/demofeed.rss' in Desktop Chrome (Not Dartium) you'll see that the headers include 'Access-Control-Allow-Origin:' in the Network tab (also shows in curl -v 'http://labs.gauntface.co.uk/eisandnose/demofeed.rss'). However loading the page directly in Dartium and looking in the network tab in DevTools, the 'Access-Control-Allow-Origin:' isn't shown.

What version of the product are you using? On what operating system?
Version 31.0.1650.39 (1593)

Please provide any additional information below.
If anyone is desperate for a way around this , you can add '--disable-web-security' in the run command of the Dart Editor, but you obviously won't be able to deploy this anywhere and runs some risks

@iposva-google
Copy link
Contributor

Added Area-Dartium, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Aug 15, 2014

This comment was originally written by mineral...@gmail.com


I believe it's the pub server that should include the access control headers.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants