FireflyServer / firefly

Firefly - a .NET HTTP server
http://loudej.github.com/firefly
Apache License 2.0
80 stars 16 forks source link

Hangs on HEAD requests with null response body #10

Open duncanpierce opened 12 years ago

duncanpierce commented 12 years ago

Hi Louis,

I've been working on an OWIN-based app that needs to respond to HEAD requests. By the HTTP/1.1 spec a HEAD request must not have a response body but the headers should be the same as if it were a GET request.

With keep-alive connections, Firefly hangs (as of 7d3492e921b9ed2b6796b9fe24e9c4aa0ad88e83) when I pass a null response body. Passing a null body is allowed for by the draft 5 OWIN spec and is required when hosting on Kayak. I think it makes sense for Firefly to handle a null response body.

Passing a body which just calls end(null) works, so for now I've implemented a small middleware component for running with Firefly.

Many thanks for Firefly - it's proving very useful for testing my async handling and I'm getting good performance from it. Duncan