Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed corner case with HEAD method and Content-Length

  • Loading branch information...
commit 5d13fab98e1bcb0f94180e67b25cabdbe710ca42 1 parent 75fe6c5
@nusco nusco authored rkh committed
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.
Please sign in to comment.
Something went wrong with that request. Please try again.