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

Unified Diff: lib/src/util.dart

Issue 851423003: Request now has the same body model as Response (Closed) Base URL: https://github.com/dart-lang/shelf.git@master
Patch Set: nits Created 5 years, 11 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 | « lib/src/response.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/util.dart
diff --git a/lib/src/util.dart b/lib/src/util.dart
index 270ea6b86ffc0cab909dd24b5cb74a60928a42b1..4154e8e0e741651648fa681a451248edeb6ed293 100644
--- a/lib/src/util.dart
+++ b/lib/src/util.dart
@@ -40,3 +40,13 @@ Map updateMap(Map original, Map updates) {
return new Map.from(original)..addAll(updates);
}
+
+/// Adds a header with [name] and [value] to [headers], which may be null.
+///
+/// Returns a new map without modifying [headers].
+Map<String, String> addHeader(
+ Map<String, String> headers, String name, String value) {
+ headers = headers == null ? {} : new Map.from(headers);
+ headers[name] = value;
+ return headers;
+}
« no previous file with comments | « lib/src/response.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698