| Index: sdk/lib/html/dart2js/html_dart2js.dart
|
| diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
|
| index e33d421417b5c54dbd7df861804c9c92101fb578..1fdbeed3c78a6b1afdcca755cf0f5b1e0a3c9a82 100644
|
| --- a/sdk/lib/html/dart2js/html_dart2js.dart
|
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart
|
| @@ -12768,6 +12768,11 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
|
| * * The `Access-Control-Allow-Credentials` header of `url` must be set to true.
|
| * * If `Access-Control-Expose-Headers` has not been set to true, only a subset of all the response headers will be returned when calling [getAllRequestHeaders].
|
| *
|
| + * Note that requests for file:// URIs are only supported by Chrome extensions
|
| + * with appropriate permissions in their manifest. Requests to file:// URIs
|
| + * will also never fail- the Future will always complete successfully, even
|
| + * when the file cannot be found.
|
| + *
|
| * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
|
| */
|
| static Future<HttpRequest> request(String url,
|
| @@ -12794,8 +12799,9 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
|
| }
|
|
|
| xhr.onLoad.listen((e) {
|
| - if (xhr.status >= 200 && xhr.status < 300 ||
|
| - xhr.status == 304 ) {
|
| + // Note: file:// URIs have status of 0.
|
| + if ((xhr.status >= 200 && xhr.status < 300) ||
|
| + xhr.status == 0 || xhr.status == 304) {
|
| completer.complete(xhr);
|
| } else {
|
| completer.completeError(e);
|
|
|