Index: pkg/shelf/lib/src/request.dart |
diff --git a/pkg/shelf/lib/src/request.dart b/pkg/shelf/lib/src/request.dart |
index 26fe011ff8d6b96135599d11574577556d4bdf79..718a5239857de879db3daad583ed1c0027e45921 100644 |
--- a/pkg/shelf/lib/src/request.dart |
+++ b/pkg/shelf/lib/src/request.dart |
@@ -116,16 +116,25 @@ class Request extends Message { |
/// |
/// See also [hijack]. |
// TODO(kevmoo) finish documenting the rest of the arguments. |
- Request(this.method, Uri requestedUri, {String protocolVersion, |
+ Request(method, Uri requestedUri, {String protocolVersion, |
nweiz
2014/10/13 18:43:43
Add a type annotation for [method].
kevmoo
2014/10/14 16:42:38
Done.
|
+ Map<String, String> headers, Uri url, String scriptName, |
+ Stream<List<int>> body, Map<String, Object> context, |
+ OnHijackCallback onHijack}) |
+ : this._(method, requestedUri, protocolVersion: protocolVersion, |
+ headers: headers, url: url, scriptName: scriptName, |
+ body: body, context: context, |
+ onHijack: onHijack == null ? null : new _OnHijack(onHijack)); |
+ |
+ Request._(this.method, Uri requestedUri, {String protocolVersion, |
nweiz
2014/10/13 18:43:43
Explain how this constructor is different than [ne
kevmoo
2014/10/14 16:42:38
Done.
|
Map<String, String> headers, Uri url, String scriptName, |
Stream<List<int>> body, Map<String, Object> context, |
- OnHijackCallback onHijack}) |
+ _OnHijack onHijack}) |
: this.requestedUri = requestedUri, |
this.protocolVersion = protocolVersion == null ? |
'1.1' : protocolVersion, |
this.url = _computeUrl(requestedUri, url, scriptName), |
this.scriptName = _computeScriptName(requestedUri, url, scriptName), |
- this._onHijack = onHijack == null ? null : new _OnHijack(onHijack), |
+ this._onHijack = onHijack, |
super(body == null ? new Stream.fromIterable([]) : body, |
headers: headers, context: context) { |
if (method.isEmpty) throw new ArgumentError('method cannot be empty.'); |
@@ -194,9 +203,10 @@ class Request extends Message { |
if (url == null) url = this.url; |
if (scriptName == null) scriptName = this.scriptName; |
- return new Request(this.method, this.requestedUri, |
+ return new Request._(this.method, this.requestedUri, |
protocolVersion: this.protocolVersion, headers: headers, url: url, |
- scriptName: scriptName, body: this.read(), context: context); |
+ scriptName: scriptName, body: this.read(), context: context, |
+ onHijack: _onHijack); |
} |
/// Takes control of the underlying request socket. |