Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: pkg/http/lib/src/io_client.dart

Issue 196423017: Make BaseRequest.contentType use null rather than -1 as a flag value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http/lib/src/base_response.dart ('k') | pkg/http/lib/src/mock_client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/io_client.dart
diff --git a/pkg/http/lib/src/io_client.dart b/pkg/http/lib/src/io_client.dart
index c12cac2d6329375e018591321c115a796204bc06..112607d4bfc17c06b8a8d554df28c845f2cdfdf6 100644
--- a/pkg/http/lib/src/io_client.dart
+++ b/pkg/http/lib/src/io_client.dart
@@ -27,10 +27,12 @@ class IOClient extends BaseClient {
return Chain.track(_inner.openUrl(request.method, request.url))
.then((ioRequest) {
+ var contentLength = request.contentLength == null ?
+ -1 : request.contentLength;
ioRequest
..followRedirects = request.followRedirects
..maxRedirects = request.maxRedirects
- ..contentLength = request.contentLength
+ ..contentLength = contentLength
..persistentConnection = request.persistentConnection;
request.headers.forEach((name, value) {
ioRequest.headers.set(name, value);
@@ -42,10 +44,12 @@ class IOClient extends BaseClient {
headers[key] = values.join(',');
});
+ var contentLength = response.contentLength == -1 ?
+ null : response.contentLength;
return new StreamedResponse(
response,
response.statusCode,
- response.contentLength,
+ contentLength: contentLength,
request: request,
headers: headers,
isRedirect: response.isRedirect,
« no previous file with comments | « pkg/http/lib/src/base_response.dart ('k') | pkg/http/lib/src/mock_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698