diff options
author | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-26 02:47:03 +0000 |
---|---|---|
committer | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-26 02:47:03 +0000 |
commit | 4ff4a7d915f01dabcb87125aa89159fcc5d48534 (patch) | |
tree | 69359452775dfb27b5bbcf7ca90f7f48db47c3fc /lib | |
parent | 14fc77f607e47f2adf77b31457d0c8a7a3300af6 (diff) | |
download | unicorn-4ff4a7d915f01dabcb87125aa89159fcc5d48534.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@740 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mongrel/handlers.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb index 9981a18..385f958 100644 --- a/lib/mongrel/handlers.rb +++ b/lib/mongrel/handlers.rb @@ -218,11 +218,14 @@ module Mongrel if same_response response.start(304) {} else - # first we setup the headers and status then we do a very fast send on the socket directly - response.status ||= 200 + + # First we setup the headers and status then we do a very fast send on the socket directly + + # Support custom responses except 404, which is the default. A little awkward. + response.status = 200 if response.status == 404 header[Const::LAST_MODIFIED] = mtime.httpdate - # set the mime type from our map based on the ending + # Set the mime type from our map based on the ending dot_at = req_path.rindex('.') if dot_at header[Const::CONTENT_TYPE] = MIME_TYPES[req_path[dot_at .. -1]] || @default_content_type |