Default middleware stack returns response body for HEAD #574

titanous opened this Issue Jun 13, 2013 · 1 comment

2 participants


The Rack::Chunked middleware in the default deployment/development stacks is oblivious to HEAD requests and returns a body, even though the HTTP spec says that there must not be a response body. There are two solutions to this that I see:

a) Add Rack::Head before Rack::Chunked in the default middleware stacks.

b) Replace the body with an empty array in Rack::Chunked when the request method is HEAD, perhaps using the same logic as Rack::Head.

@raggi raggi modified the milestone: Rack 1.5.3, Rack 1.6 Jul 12, 2014
Official Rack repositories member

tbh, Chunked, Head, Content-Length and so on want to be pushed into servers over time. They shouldn't really be implemented as middleware, as they need to be coupled concerns for high performance servers.

@raggi raggi closed this Aug 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment