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

Unified Diff: runtime/bin/http_impl.dart

Issue 10386040: Avoid using chunked transfer encoding when the HTTP verision is 1.0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
Index: runtime/bin/http_impl.dart
diff --git a/runtime/bin/http_impl.dart b/runtime/bin/http_impl.dart
index ffe4563615fc3f88ff4147d34a447c44f1642841..58f0bbaf163a7dc58da5760eaffd80ab4a87bb70 100644
--- a/runtime/bin/http_impl.dart
+++ b/runtime/bin/http_impl.dart
@@ -399,6 +399,8 @@ class _HttpRequest extends _HttpRequestResponseBase implements HttpRequest {
return _inputStream;
}
+ String get protocolVersion() => _protocolVersion;
+
void _onRequestStart(String method, String uri, String version) {
_method = method;
_uri = uri;
@@ -610,6 +612,11 @@ class _HttpResponse extends _HttpRequestResponseBase implements HttpResponse {
bool _writeHeader() {
List<int> data;
+ // HTTP/1.0 does not support chunked.
+ if (_protocolVersion == "1.0" && _contentLength < 0) {
+ throw new HttpException("Content length required for HTTP 1.0");
+ }
+
// Write status line.
if (_protocolVersion == "1.1") {
_httpConnection._write(_Const.HTTP11);

Powered by Google App Engine
This is Rietveld 408576698