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

http/xhr_test.dart should update its expectations for server response headers from dart:io #20580

Open
whesse opened this issue Aug 19, 2014 · 1 comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@whesse
Copy link
Member

whesse commented Aug 19, 2014

There is a test that currently expects the HTTP server serving test files and data to provide a server header server: 'Dart/0.1 (dart:io)'

Recent changes make HttpServer provide other default headers, and no server header. Either the test should be changed to expect what it provides. The new headers provided by bleeding-edge Dart are:

access-control-allow-origin:*
cache-control:max-age=30
content-encoding:gzip
content-type:text/plain; charset=utf-8
x-content-type-options:nosniff
x-xss-protection:1; mode=block

And the old headers provided by the Dart in tools/testing/bin/linux/dart are:

access-control-allow-origin:*
content-encoding:gzip
server:Dart/1.0 (dart:io)
transfer-encoding:chunked

Feel free to assign the bug to me, and give your input on whether we should be testing these default headers.

@sgjesse
Copy link
Contributor

sgjesse commented Aug 28, 2014

Having a test that checks that XHR headers are actually working is a good thing. However it should only check for headers that we know are there, that is something that the test server provides.

The current resource being read is '/root_dart/tests/html/xhr_cross_origin_data.txt?cacheBlock=$cacheBlocker', so the header 'content-type:text/plain; charset=utf-8' should be set if the test server is behaving correctly.

Another option is to add an additional fixed entrypoint in the test server which can deliver arbitrary headers, e.g.:

/generate_headers?foo=bar&dart=cool

will return a response with the headers

foo:bar
dart:cool

We should also be testing that headers set on XHR is send to the server. One option could be

/headers_to_body

which will return the headers in the body somehow, either as application/x-www-form-urlencoded or application/json.

@kevmoo kevmoo added the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label Jun 16, 2015
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants