From 0660f36c162714afcab221638ec2f703d20425ab Mon Sep 17 00:00:00 2001 From: evanweaver Date: Mon, 12 Nov 2007 20:06:56 +0000 Subject: apply #15590 (Aman Gupta) git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@875 19e92222-5c0b-0410-8929-a290d50e31e9 --- lib/mongrel/http_response.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/mongrel/http_response.rb b/lib/mongrel/http_response.rb index ff715cc..1eb7077 100644 --- a/lib/mongrel/http_response.rb +++ b/lib/mongrel/http_response.rb @@ -43,7 +43,6 @@ module Mongrel @socket = socket @body = StringIO.new @status = 404 - @reason = HTTP_STATUS_CODES[@status] @header = HeaderOut.new(StringIO.new) @header[Const::DATE] = Time.now.httpdate @body_sent = false @@ -59,7 +58,7 @@ module Mongrel # by simple passing "finalize=true" to the start method. By default # all handlers run and then mongrel finalizes the request when they're # all done. - def start(status=200, finalize=false, reason=HTTP_STATUS_CODES[status]) + def start(status=200, finalize=false, reason=nil) @status = status.to_i @reason = reason yield @header, @body @@ -84,7 +83,7 @@ module Mongrel def send_status(content_length=@body.length) if not @status_sent @header['Content-Length'] = content_length if content_length and @status != 304 - write(Const::STATUS_FORMAT % [@status, @reason]) + write(Const::STATUS_FORMAT % [@status, @reason || HTTP_STATUS_CODES[@status]]) @status_sent = true end end -- cgit v1.2.3-24-ge0c7