diff options
author | Eric Wong <e@80x24.org> | 2015-05-11 23:58:08 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-05-12 00:28:59 +0000 |
commit | 313b0236c03eebd9f8074b11ff0b1778e22a87d4 (patch) | |
tree | 47719efc7711f76b16644dcca3a053f179e8c71c | |
parent | 65e50864082a99af2ecc03132d5b9c9a8a878c27 (diff) | |
download | yahns-313b0236c03eebd9f8074b11ff0b1778e22a87d4.tar.gz |
It does not release memory immediately and GC can handle it reliably, so don't waste a constant lookup + cache entry on it. While we're at it, explain why we can't do a simpler respond_to? check instead.
-rw-r--r-- | lib/yahns/proxy_pass.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb index 7bbab51..15c9f53 100644 --- a/lib/yahns/proxy_pass.rb +++ b/lib/yahns/proxy_pass.rb @@ -149,8 +149,10 @@ class Yahns::ProxyPass # :nodoc: end def close_req_body(input) + # we cannot use respond_to?(:close) here since Rack::Lint::InputWrapper + # tries to prevent that (and hijack means all Rack specs go out the door) case input - when Yahns::TeeInput, IO, StringIO + when Yahns::TeeInput, IO input.close end end |