Permalink
Browse files

Merge branch 'master' of github.com:sinatra/sinatra

  • Loading branch information...
2 parents b69917f + 02d746d commit c3e1f5f27c441f592fb76657d8e0e32e5e404b0b @rkh rkh committed Apr 27, 2011
Showing with 2 additions and 11 deletions.
  1. +2 −11 lib/sinatra/base.rb
View
@@ -652,17 +652,7 @@ def call!(env) # :nodoc:
end
end
- status, header, body = @response.finish
-
- # Never produce a body on HEAD requests. Do retain the Content-Length
- # unless it's "0", in which case we assume it was calculated erroneously
- # for a manual HEAD response and remove it entirely.
- if @env['REQUEST_METHOD'] == 'HEAD'
- body = []
- header.delete('Content-Length') if header['Content-Length'] == '0'
- end
-
- [status, header, body]
+ @response.finish
end
# Access settings defined with Base.set.
@@ -1272,6 +1262,7 @@ def build(*args, &bk)
builder = Rack::Builder.new
builder.use Rack::MethodOverride if method_override?
builder.use ShowExceptions if show_exceptions?
+ builder.use Rack::Head
setup_logging builder
setup_sessions builder
middleware.each { |c,a,b| builder.use(c, *a, &b) }

0 comments on commit c3e1f5f

Please sign in to comment.