twitter/finatra — pull request #124 by grandbora (2014-03-12 04:15:05+00:00)
Title: Add content-length: 0 for no content responses

* adds ```Content-Length: 0``` header to no content responses

In the current version content length header is not added if there isn't any content in the response. This behaviour creates a problem when accessing finatra application through an nginx proxy server. Since application doesn't send length data, the proxy server keeps the connection open until it times out. This results into long response times for responses to option requests, 301 responses etc.

[Here](https://github.com/grandbora/finatra-test-app/blob/master/TestApp/src/main/scala/com/sc/TestApp/App.scala#L20-L31) I created two endpoints where the difference can be observed. Although when accessed from browser both endpoints behaves the same (and fine), when accessed via curl the behaviour is different. On the ```/redirect-without-header``` endpoint curl hangs [forever](http://cdn2.scratch.mit.edu/get_image/gallery/256731_170x100.png?v=1380430516.91).

cc @pcalcado @streadway