Chromium Code Reviews| Index: sdk/lib/io/http_impl.dart |
| diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart |
| index 42c1db9843c22ec0041a4231469a7118a70beefe..9467fdb84a24bc34aaa755a8b145e63febdcb038 100644 |
| --- a/sdk/lib/io/http_impl.dart |
| +++ b/sdk/lib/io/http_impl.dart |
| @@ -1289,8 +1289,24 @@ class _HttpClientConnection { |
| "Unexpected response (unsolicited response without request).", |
| uri: _currentUri); |
| } |
| - _nextResponseCompleter.complete(incoming); |
| - _nextResponseCompleter = null; |
| + |
| + // Check for status code '100 Continue'. In that case just |
| + // consume that response as the final response will follow |
| + // it. There is currently no API for the client to wait for |
| + // the '100 Continue' response. |
| + if (incoming.statusCode == 100) { |
| + incoming.drain().then((_) { |
| + _subscription.resume(); |
| + }).catchError((error, [StackTrace stackTrace]) { |
| + _nextResponseCompleter.completeError( |
| + new HttpException(error.message, uri: _currentUri), |
|
kustermann
2015/05/11 12:51:41
indentation
Søren Gjesse
2015/05/11 13:41:13
Done.
|
| + stackTrace); |
| + _nextResponseCompleter = null; |
| + }); |
| + } else { |
| + _nextResponseCompleter.complete(incoming); |
| + _nextResponseCompleter = null; |
| + } |
| }, |
| onError: (error, [StackTrace stackTrace]) { |
| if (_nextResponseCompleter != null) { |