Skip to content
Browse files

Merge pull request #457 from raggi/fix_head_requests

Fix a bug where head requests were resulting in a 0 content-length
  • Loading branch information...
2 parents b75e696 + e86583c commit 9ab66a609ce2affec1d676f4b171e9ece609049a @rkh rkh committed Jan 22, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/sinatra/base.rb
View
1 lib/sinatra/base.rb
@@ -229,6 +229,7 @@ def send_file(path, opts={})
file.path = path
result = file.serving env
result[1].each { |k,v| headers[k] ||= v }
+ headers['Content-Length'] = result[1]['Content-Length']
halt opts[:status] || result[0], result[2]
rescue Errno::ENOENT
not_found

0 comments on commit 9ab66a6

Please sign in to comment.
Something went wrong with that request. Please try again.