aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/integration.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-02-01 17:54:45 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-02-01 17:54:45 +0000
commita390b2629a7de7cb8a8a5370aa493283c4a3f066 (patch)
tree95450d80d313e13c6a235c722761ea70aca54555 /actionpack/lib/action_controller/integration.rb
parenta4ff4fd2c38175b38af928da2b5cae2b6bb19da7 (diff)
parent3be0ad60e4fcdafd4817508a21340dbf1bda6cb4 (diff)
downloadrails-a390b2629a7de7cb8a8a5370aa493283c4a3f066.tar.gz
rails-a390b2629a7de7cb8a8a5370aa493283c4a3f066.tar.bz2
rails-a390b2629a7de7cb8a8a5370aa493283c4a3f066.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/lib/action_controller/integration.rb')
-rw-r--r--actionpack/lib/action_controller/integration.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb
index 163ba84a3e..a0e894108d 100644
--- a/actionpack/lib/action_controller/integration.rb
+++ b/actionpack/lib/action_controller/integration.rb
@@ -26,6 +26,9 @@ module ActionController
# The status message that accompanied the status code of the last request.
attr_reader :status_message
+ # The body of the last request.
+ attr_reader :body
+
# The URI of the last request.
attr_reader :path
@@ -308,7 +311,11 @@ module ActionController
ActionController::Base.clear_last_instantiation!
- app = Rack::Lint.new(@application)
+ app = @application
+ # Rack::Lint doesn't accept String headers or bodies in Ruby 1.9
+ unless RUBY_VERSION >= '1.9.0' && Rack.release <= '0.9.0'
+ app = Rack::Lint.new(app)
+ end
status, headers, body = app.call(env)
@request_count += 1
@@ -326,7 +333,11 @@ module ActionController
end
@body = ""
- body.each { |part| @body << part }
+ if body.is_a?(String)
+ @body << body
+ else
+ body.each { |part| @body << part }
+ end
if @controller = ActionController::Base.last_instantiation
@request = @controller.request