NancyFx/Nancy — Issue #429: Default error handler ignores response contents
Author: nolanw
Created: 2011-12-01 19:18:36+00:00
State: open

Here's a trivial module hosted on ASP.NET

```c#
public HelloModule ()
{
Get["/hi"] =
parameters =>
new Response()
{
StatusCode = HttpStatusCode.NotFound,
Contents = stream => (new StreamWriter(stream) {AutoFlush = true}).Write("not found"),
ContentType = "text/plain"
};
}
```

If I run the development server and go to `/hi`, I see the default Nancy not found page. I'd expect to see the text `not found`.

There's a workaround: overriding the default error handler with one that doesn't stomp over the response contents. To me, however, it's surprising that the above code doesn't work.