serbajlo/Nancy — comment on commit 117a11d61d8662f74b834fce1d94b180ac026ccb
File:  line 0
By SimonCropp:

this does not conform to the nancy pattern of delayed reading of the resource.

should be something like this

public class StreamResponse : Response
{
public StreamResponse(Func getStream, string contentType)
{
Contents = destinationStream =>
{
using (var stream = getStream())
{
stream.CopyTo(destinationStream);
}
};
ContentType = contentType;
StatusCode = HttpStatusCode.OK;
}
}