From 4ff4a7d915f01dabcb87125aa89159fcc5d48534 Mon Sep 17 00:00:00 2001 From: evanweaver Date: Fri, 26 Oct 2007 02:47:03 +0000 Subject: thank god for those tests git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@740 19e92222-5c0b-0410-8929-a290d50e31e9 --- lib/mongrel/handlers.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/mongrel') 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 -- cgit v1.2.3-24-ge0c7