From 652b9b6973cd0f638c6eb0e83f41ca2f1aca0803 Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 29 Mar 2016 03:45:32 +0000 Subject: * lib/webrick/httpresponse.rb: Move error_body to method. It allow to override the body more easily. [fix GH-1307] * test/webrick/test_httpresponse.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/webrick/httpresponse.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/webrick') diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb index 5fd54b77c7..eae14d6597 100644 --- a/lib/webrick/httpresponse.rb +++ b/lib/webrick/httpresponse.rb @@ -352,6 +352,14 @@ module WEBrick host, port = @config[:ServerName], @config[:Port] end + error_body(backtrace, ex, host, port) + end + + private + + # :stopdoc: + + def error_body(backtrace, ex, host, port) @body = '' @body << <<-_end_of_html_ @@ -381,10 +389,6 @@ module WEBrick _end_of_html_ end - private - - # :stopdoc: - def send_body_io(socket) begin if @request_method == "HEAD" -- cgit v1.2.3