Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Commit d76e7ef

Browse files
authored
Merge pull request #2512 from danbarua/master
Replace dependency on RequestStream in Request.Body with Stream
2 parents fc9cda6 + 90ae351 commit d76e7ef

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Nancy/Request.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public Request(string method, string path, string scheme)
4747
/// <param name="protocolVersion">The HTTP protocol version.</param>
4848
public Request(string method,
4949
Url url,
50-
RequestStream body = null,
50+
Stream body = null,
5151
IDictionary<string, IEnumerable<string>> headers = null,
5252
string ip = null,
5353
X509Certificate certificate = null,
@@ -148,10 +148,10 @@ public string Path
148148
public dynamic Query { get; set; }
149149

150150
/// <summary>
151-
/// Gets a <see cref="RequestStream"/> that can be used to read the incoming HTTP body
151+
/// Gets a <see cref="Stream"/> that can be used to read the incoming HTTP body
152152
/// </summary>
153-
/// <value>A <see cref="RequestStream"/> object representing the incoming HTTP body.</value>
154-
public RequestStream Body { get; private set; }
153+
/// <value>A <see cref="Stream"/> object representing the incoming HTTP body.</value>
154+
public Stream Body { get; private set; }
155155

156156
/// <summary>
157157
/// Gets the request cookies.

test/Nancy.Tests.Functional/Modules/SerializerTestModule.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Globalization;
55
using Nancy.Extensions;
6+
using Nancy.IO;
67
using Nancy.ModelBinding;
78

89
public class SerializerTestModule : NancyModule
@@ -25,7 +26,7 @@ public SerializerTestModule()
2526

2627
Post("/serializer/date", args =>
2728
{
28-
var s = this.Request.Body.AsString();
29+
var s = ((RequestStream)this.Request.Body).AsString();
2930
var model = this.Bind<FakeSerializerModel>();
3031
return model;
3132
});

0 commit comments

Comments
 (0)