diff options
author | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-11 07:22:37 +0000 |
---|---|---|
committer | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-11 07:22:37 +0000 |
commit | 370a88b2e428a41008d2f9e4e2c2a4ed215ab873 (patch) | |
tree | d051124162f20217b092959a084e35b1720409ec /lib/mongrel.rb | |
parent | e577ab7e62af6674acf3292eda9f604981b48202 (diff) | |
download | unicorn-370a88b2e428a41008d2f9e4e2c2a4ed215ab873.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@640 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel.rb')
-rw-r--r-- | lib/mongrel.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mongrel.rb b/lib/mongrel.rb index 5ed1e66..3569e07 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -406,6 +406,7 @@ 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 @@ -421,8 +422,9 @@ 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) + def start(status=200, finalize=false, reason=HTTP_STATUS_CODES[status]) @status = status.to_i + @reason = reason yield @header, @body finished if finalize end @@ -445,7 +447,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, HTTP_STATUS_CODES[@status]]) + write(Const::STATUS_FORMAT % [@status, @reason]) @status_sent = true end end |