about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/mongrel/http_response.rb5
1 files changed, 2 insertions, 3 deletions
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