#366 Rewind the request buffer after parsing the form.
This commit is contained in:
parent
43d0b0f65b
commit
4e0f0c79ec
|
|
@ -152,6 +152,9 @@ namespace Microsoft.AspNet.Http.Features.Internal
|
|||
}
|
||||
}
|
||||
|
||||
// Rewind so later readers don't have to.
|
||||
_request.Body.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
Form = new FormCollection(formFields, files);
|
||||
return Form;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ namespace Microsoft.AspNet.Http.Features.Internal
|
|||
// Assert
|
||||
Assert.Equal("bar", formCollection["foo"]);
|
||||
Assert.Equal("2", formCollection["baz"]);
|
||||
Assert.Equal(0, context.Request.Body.Position);
|
||||
Assert.True(context.Request.Body.CanSeek);
|
||||
|
||||
// Cached
|
||||
formFeature = context.Features.Get<IFormFeature>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue