Permalink
Browse files

when debugging, don't dump binary data; display message instead

Signed-off-by: Hiroshi Nakamura <nahi@ruby-lang.org>
  • Loading branch information...
1 parent 2cdbb6b commit cfc2abca1cbdc4a5b0af7d822c6d0a7fc8252457 @chetan chetan committed with Sep 7, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/httpclient/session.rb
@@ -435,7 +435,13 @@ def <<(str)
private
def debug(str)
- @debug_dev << str if str && @debug_dev
+ if str && @debug_dev
+ if str.include? "\0" then
+ @debug_dev << "#{str.length} bytes of possible binary data\n"
+ else
+ @debug_dev << str
+ end
+ end
end
end

0 comments on commit cfc2abc

Please sign in to comment.