aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-07-16 04:17:28 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-07-16 04:17:28 +0100
commit5cc3ea6969f047a782fa8ac44530baeef597edb3 (patch)
tree43c277e05c9caafcb4ff65d9b31ac7d6bfd3974a /actionpack
parent3343eb428c502006c40368231a154d8f82be97eb (diff)
downloadrails-5cc3ea6969f047a782fa8ac44530baeef597edb3.tar.gz
rails-5cc3ea6969f047a782fa8ac44530baeef597edb3.tar.bz2
rails-5cc3ea6969f047a782fa8ac44530baeef597edb3.zip
RackResponse should not contain Status header
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/rack_process.rb2
-rw-r--r--actionpack/test/controller/rack_test.rb16
2 files changed, 14 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/rack_process.rb b/actionpack/lib/action_controller/rack_process.rb
index dfa2b8d0bd..614913fcd9 100644
--- a/actionpack/lib/action_controller/rack_process.rb
+++ b/actionpack/lib/action_controller/rack_process.rb
@@ -250,7 +250,7 @@ end_msg
headers['Content-Language'] = options.delete('language') if options['language']
headers['Expires'] = options.delete('expires') if options['expires']
- @status = options['Status'] || "200 OK"
+ @status = options.delete('Status') || "200 OK"
# Convert 'cookie' header to 'Set-Cookie' headers.
# Because Set-Cookie header can appear more the once in the response body,
diff --git a/actionpack/test/controller/rack_test.rb b/actionpack/test/controller/rack_test.rb
index 0636a85013..1cef1e0f58 100644
--- a/actionpack/test/controller/rack_test.rb
+++ b/actionpack/test/controller/rack_test.rb
@@ -252,18 +252,28 @@ class RackResponseHeadersTest < BaseRackTest
super
@response = ActionController::RackResponse.new(@request)
@output = StringIO.new('')
- @headers = proc { @response.out(@output)[1] }
+ @response.headers['Status'] = 200
end
def test_content_type
[204, 304].each do |c|
@response.headers['Status'] = c
- assert !@headers.call.has_key?("Content-Type")
+ assert !response_headers.has_key?("Content-Type")
end
[200, 302, 404, 500].each do |c|
@response.headers['Status'] = c
- assert @headers.call.has_key?("Content-Type")
+ assert response_headers.has_key?("Content-Type")
end
end
+
+ def test_status
+ assert !response_headers.has_key?('Status')
+ end
+
+ private
+
+ def response_headers
+ @response.out(@output)[1]
+ end
end