Permalink
Browse files

Removed corner case with HEAD method and Content-Length

  • Loading branch information...
1 parent 7b146e2 commit 250968080e4de575e1effb54ff3175e9051c7038 @nusco nusco committed Apr 26, 2011
Showing with 1 addition and 10 deletions.
  1. +1 −10 lib/sinatra/base.rb
View
11 lib/sinatra/base.rb
@@ -646,16 +646,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 2509680

Please sign in to comment.