Issue #10715 has been updated by jeremyevans0 (Jeremy Evans).


It looks like `WEBrick::HTTPResponse#to_s` is currently broken anyway (https://github.com/ruby/webrick/pull/20).  I agree that it makes sense to remove the method, and added a pull request to do so (https://github.com/ruby/webrick/pull/22).

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

* Author: yoshiokatsuneo (Tsuneo Yoshioka)
* Status: Open
* Priority: Normal
* Assignee: 
* 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/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>