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

Unified Diff: sdk/lib/io/http_impl.dart

Issue 12595004: Fix handling to responses to HEAD requests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 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 | « no previous file | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index b4d83af6f213afe73fe422b2b1882bff70e862a3..a145e39b086b163f6d638dee158a2a33208a6d4d 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -398,11 +398,8 @@ abstract class _HttpOutboundMessage<T> implements IOSink {
void _writeHeaders() {
if (_headersWritten) return;
- bool _tmpIgnoreBody = _ignoreBody;
- _ignoreBody = false;
_headersWritten = true;
_writeHeader();
- _ignoreBody = _tmpIgnoreBody;
if (_ignoreBody) {
_ioSink.close();
return;
@@ -455,19 +452,19 @@ class _HttpResponse extends _HttpOutboundMessage<HttpResponse>
HttpConnectionInfo get connectionInfo => _httpRequest.connectionInfo;
void _writeHeader() {
- writeSP() => add([_CharCode.SP]);
- writeCRLF() => add([_CharCode.CR, _CharCode.LF]);
+ writeSP() => _ioSink.add([_CharCode.SP]);
+ writeCRLF() => _ioSink.add([_CharCode.CR, _CharCode.LF]);
// Write status line.
if (headers.protocolVersion == "1.1") {
- add(_Const.HTTP11);
+ _ioSink.add(_Const.HTTP11);
} else {
- add(_Const.HTTP10);
+ _ioSink.add(_Const.HTTP10);
}
writeSP();
- addString(statusCode.toString());
+ _ioSink.addString(statusCode.toString());
writeSP();
- addString(reasonPhrase);
+ _ioSink.addString(reasonPhrase);
writeCRLF();
var session = _httpRequest._session;
@@ -498,7 +495,7 @@ class _HttpResponse extends _HttpOutboundMessage<HttpResponse>
headers._finalize();
// Write headers.
- headers._write(this);
+ headers._write(_ioSink);
writeCRLF();
}
@@ -648,10 +645,10 @@ class _HttpClientRequest extends _HttpOutboundMessage<HttpClientRequest>
}
void _writeHeader() {
- writeSP() => add([_CharCode.SP]);
- writeCRLF() => add([_CharCode.CR, _CharCode.LF]);
+ writeSP() => _ioSink.add([_CharCode.SP]);
+ writeCRLF() => _ioSink.add([_CharCode.CR, _CharCode.LF]);
- addString(method);
+ _ioSink.addString(method);
writeSP();
// Send the path for direct connections and the whole URL for
// proxy connections.
@@ -665,12 +662,12 @@ class _HttpClientRequest extends _HttpOutboundMessage<HttpClientRequest>
path = "${path}?${uri.query}";
}
}
- addString(path);
+ _ioSink.addString(path);
} else {
- addString(uri.toString());
+ _ioSink.addString(uri.toString());
}
writeSP();
- add(_Const.HTTP11);
+ _ioSink.add(_Const.HTTP11);
writeCRLF();
// Add the cookies to the headers.
@@ -688,7 +685,7 @@ class _HttpClientRequest extends _HttpOutboundMessage<HttpClientRequest>
headers._finalize();
// Write headers.
- headers._write(this);
+ headers._write(_ioSink);
writeCRLF();
}
}
« no previous file with comments | « no previous file | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698