Project

General

Profile

Actions

Bug #10715

closed

WEBrick::HTTPResponse#to_s calls send_response(), and make debugging quite difficult.

Added by yoshiokatsuneo (Tsuneo Yoshioka) about 9 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:67428]

Description

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.

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

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).

Updated by ko1 (Koichi Sasada) over 4 years ago

  • Status changed from Open to Closed

should we continue on github issue?

Actions

Also available in: Atom PDF

Like0
Like0Like0