about summary refs log tree commit homepage
path: root/lib/mongrel/handlers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mongrel/handlers.rb')
-rw-r--r--lib/mongrel/handlers.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb
index b308194..6bc2a70 100644
--- a/lib/mongrel/handlers.rb
+++ b/lib/mongrel/handlers.rb
@@ -169,7 +169,7 @@ module Mongrel
         ext = req[dot_at .. -1]
         if MIME_TYPES[ext]
           stat = File.stat(req)
-          response.header[Const::CONTENT_TYPE] = MIME_TYPES[ext]
+          response.header[Const::CONTENT_TYPE] = MIME_TYPES[ext] || "text"
           # TODO: Confirm this works for rfc 1123
           response.header[Const::LAST_MODIFIED] = HttpServer.httpdate(stat.mtime)
           # TODO that this is a valid way to calculate an etag
@@ -187,7 +187,7 @@ module Mongrel
           else
             File.open(req, "rb") { |f| response.socket.write(f.read) }
           end
-        rescue EOFError,Errno::ECONNRESET,Errno::EPIPE
+        rescue EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL
           # ignore these since it means the client closed off early
         end
       else