diff options
Diffstat (limited to 'actionpack/lib/action_controller/integration.rb')
-rw-r--r-- | actionpack/lib/action_controller/integration.rb | 15 |
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 |