Issue #10715 has been reported by Tsuneo Yoshioka.

----------------------------------------
Bug #10715: WEBrick::HTTPResponse#to_s calls send_response(), and make debugging quite difficult.
https://bugs.ruby-lang.org/issues/10715

* Author: Tsuneo Yoshioka
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: trunk
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
WEBrick::HTTPResponse#to_s calls send_response(), and this makes debugging very difficult.
If I run webrick on debugger or just do "print" debug, and show status of the object in some point,
then debugger or "print" may calls "to_s" and go to weird status (like setting content-length to zero and never changes).

I suggest to remove "to_s" method from WEBrick::HTTPResponse, and just directly call
"send_response" instead of "to_s" when needed.




-- 
https://bugs.ruby-lang.org/