diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-04-08 20:42:11 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-04-08 20:42:11 +0000 |
commit | d9523cba31aff4640b7a64f22014ae7f9d55acc8 (patch) | |
tree | c533c08f9cf5a1a5083b6e0bebcca2f7d46a5208 /lib/mongrel/handlers.rb | |
parent | d95ed2690eaad1624a3797ee263ffc5b99819873 (diff) | |
download | unicorn-d9523cba31aff4640b7a64f22014ae7f9d55acc8.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@152 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel/handlers.rb')
-rw-r--r-- | lib/mongrel/handlers.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb index b060329..6496d90 100644 --- a/lib/mongrel/handlers.rb +++ b/lib/mongrel/handlers.rb @@ -178,15 +178,11 @@ module Mongrel header[Const::ETAG] = Const::ETAG_FORMAT % [stat.mtime.to_i, stat.size, stat.ino] # set the mime type from our map based on the ending - dot_at = req.rindex(".") - if dot_at and MIME_TYPES.has_key? req[dot_at .. -1] - header[Const::CONTENT_TYPE] = MIME_TYPES[ext] || @default_content_type - # TODO: Confirm this works for rfc 1123 - else - header[Const::CONTENT_TYPE] = @default_content_type + dot_at = req.rindex(".") + if dot_at + header[Const::CONTENT_TYPE] = MIME_TYPES[req[dot_at .. -1]] || @default_content_type end - # send a status with out content length response.send_status(stat.size) response.send_header |