| Index: tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
|
| diff --git a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
|
| index 078d873b230c53637867d92323a520d0ae3bedda..1b7546435efdb78107705744a9a13371b555f06f 100644
|
| --- a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
|
| +++ b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
|
| @@ -69,6 +69,11 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
| * * 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,
|
| @@ -95,8 +100,9 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
| }
|
|
|
| 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);
|
|
|