Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 9ab66a609ce2affec1d676f4b171e9ece609049a 2 parents b75e696 + e86583c
@rkh rkh authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.