From 506df98df1dae59281fbb3b3c2c6bea7549a2288 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Jun 2012 14:36:35 -0700 Subject: middleware/proxy: favor __send__ for method dispatch "send" is more likely to be overridden in subclasses whereas the Ruby runtime (at least 1.9.3) will warn loudly if any user code (re)defines the "__send__" method. For example, BasicSocket#send and UDPSocket#send in the Ruby stdlib are wrappers for the send(2)/sendto(2) system calls, and it's entirely possible an application could return a Socket-subclass as a Rack response body. --- lib/raindrops/middleware/proxy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/raindrops/middleware/proxy.rb b/lib/raindrops/middleware/proxy.rb index ce634bb..1cf437c 100644 --- a/lib/raindrops/middleware/proxy.rb +++ b/lib/raindrops/middleware/proxy.rb @@ -35,6 +35,6 @@ class Raindrops::Middleware::Proxy # Avoid breaking users of non-standard extensions (e.g. #body) # Rack::BodyProxy does the same. def method_missing(*args, &block) - @body.send(*args, &block) + @body.__send__(*args, &block) end end -- cgit v1.2.3-24-ge0c7