Index: pkg/shelf/lib/src/message.dart |
diff --git a/pkg/shelf/lib/src/message.dart b/pkg/shelf/lib/src/message.dart |
index 737c72224f88ee21172239a971e776371ddf7dba..f3ba22fe1bdeb126802e7050cd9327c3fb679a15 100644 |
--- a/pkg/shelf/lib/src/message.dart |
+++ b/pkg/shelf/lib/src/message.dart |
@@ -23,8 +23,18 @@ abstract class Message { |
/// This can be read via [read] or [readAsString]. |
final Stream<List<int>> _body; |
- Message(UnmodifiableMapView<String, String> headers, this._body) |
- : this.headers = headers; |
+ /// Extra context parameters for handlers to pass data to subsequent handlers. |
+ /// Note: for requests this means downstream handlers. |
+ /// For responses this means upstream handlers. |
+ /// |
+ /// The value is immutable. |
+ final Map<String, Object> context; |
+ |
+ |
+ Message(UnmodifiableMapView<String, String> headers, this._body, |
+ [ UnmodifiableMapView<String, Object> context ]) |
+ : this.headers = headers, |
+ this.context = context; |
/// The contents of the content-length field in [headers]. |
/// |