Permalink
Browse files

send_data should set Content-Length as a string

  • Loading branch information...
1 parent a491b19 commit 6720b25b2da5e1b81494d4dcc6248f64479a5db8 @josh josh committed Jun 25, 2009
Showing with 2 additions and 2 deletions.
  1. +1 −1 actionpack/lib/action_controller/streaming.rb
  2. +1 −1 actionpack/test/controller/send_file_test.rb
@@ -161,7 +161,7 @@ def send_file_headers!(options)
content_type = content_type.to_s.strip # fixes a problem with extra '\r' with some browsers
headers.merge!(
- 'Content-Length' => options[:length],
+ 'Content-Length' => options[:length].to_s,
'Content-Type' => content_type,
'Content-Disposition' => disposition,
'Content-Transfer-Encoding' => 'binary'
@@ -108,7 +108,7 @@ def test_send_file_headers!
@controller.send(:send_file_headers!, options)
h = @controller.headers
- assert_equal 1, h['Content-Length']
+ assert_equal '1', h['Content-Length']
assert_equal 'image/png', h['Content-Type']
assert_equal 'disposition; filename="filename"', h['Content-Disposition']
assert_equal 'binary', h['Content-Transfer-Encoding']

0 comments on commit 6720b25

Please sign in to comment.