Skip to content

Commit

Permalink
be smarter about forwarding methods to response
Browse files Browse the repository at this point in the history
Only forward if the response object responds to the given
message. This makes exceptions a bit easier to track down.
  • Loading branch information
rtomayko committed Sep 7, 2008
1 parent eef025c commit 9f572fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/sinatra.rb
Expand Up @@ -845,7 +845,11 @@ def reset!
private

def method_missing(name, *args, &b)
@response.send(name, *args, &b)
if @response.respond_to?(name)
@response.send(name, *args, &b)
else
super
end
end

end
Expand Down

0 comments on commit 9f572fc

Please sign in to comment.