Browse files

Removed corner case with HEAD method and Content-Length

  • Loading branch information...
1 parent 75fe6c5 commit 5d13fab98e1bcb0f94180e67b25cabdbe710ca42 @nusco nusco committed with rkh Apr 26, 2011
Showing with 1 addition and 10 deletions.
  1. +1 −10 lib/sinatra/base.rb
View
11 lib/sinatra/base.rb
@@ -651,16 +651,7 @@ def call!(env) # :nodoc:
end
end
- status, header, body = @response.finish
-
- # On HEAD requests, if the Content-Length is "0", assume
- # it was calculated erroneously for a manual HEAD response
- # and remove it entirely.
- if @env['REQUEST_METHOD'] == 'HEAD'
- header.delete('Content-Length') if header['Content-Length'] == '0'
- end
-
- [status, header, body]
+ @response.finish
end
# Access settings defined with Base.set.

0 comments on commit 5d13fab

Please sign in to comment.