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

Unified Diff: utils/pub/http.dart

Issue 12820009: Fix some analyzer warnings in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/http.dart
diff --git a/utils/pub/http.dart b/utils/pub/http.dart
index b66f28d749f72b2fa79851f0ac700094b2dc429a..bd68b45680c0f1a532b46ee48fdc06b705e9cf98 100644
--- a/utils/pub/http.dart
+++ b/utils/pub/http.dart
@@ -90,21 +90,23 @@ class PubHttpClient extends http.BaseClient {
var contentTypeString = request.headers[HttpHeaders.CONTENT_TYPE];
if (contentTypeString == null) contentTypeString = '';
var contentType = new ContentType.fromString(contentTypeString);
- if (contentType.value == 'application/x-www-form-urlencoded') {
- requestLog.writeln('');
- requestLog.writeln("Body fields:");
- request.bodyFields.forEach((name, value) =>
- requestLog.writeln(_logField(name, value)));
- } else if (contentType.value == 'text/plain' ||
- contentType.value == 'application/json') {
- requestLog.write(request.body);
- } else if (request is http.MultipartRequest) {
+ if (request is http.MultipartRequest) {
requestLog.writeln('');
requestLog.writeln("Body fields:");
request.fields.forEach((name, value) =>
requestLog.writeln(_logField(name, value)));
// TODO(nweiz): make MultipartRequest.files readable, and log them?
+ } else if (request is http.Request) {
+ if (contentType.value == 'application/x-www-form-urlencoded') {
+ requestLog.writeln('');
+ requestLog.writeln("Body fields:");
+ request.bodyFields.forEach((name, value) =>
+ requestLog.writeln(_logField(name, value)));
+ } else if (contentType.value == 'text/plain' ||
+ contentType.value == 'application/json') {
+ requestLog.write(request.body);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698