Skip to content

Commit

Permalink
Make AD::Response correctly handle bodies that respond_to?(:to_path) …
Browse files Browse the repository at this point in the history
…as per the Rack spec
  • Loading branch information
Carlhuda committed Feb 24, 2010
1 parent 3345af6 commit a73f682
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions actionpack/lib/action_dispatch/http/response.rb
Expand Up @@ -82,6 +82,18 @@ def message
end end
alias_method :status_message, :message alias_method :status_message, :message


def respond_to?(method)
if method.to_sym == :to_path
@body.respond_to?(:to_path)
else
super
end
end

def to_path
@body.to_path
end

def body def body
str = '' str = ''
each { |part| str << part.to_s } each { |part| str << part.to_s }
Expand Down

0 comments on commit a73f682

Please sign in to comment.