about summary refs log tree commit homepage
path: root/lib/mongrel/handlers.rb
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-12-15 11:12:19 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-12-15 11:12:19 +0000
commitc4fc2effca0da9ec38a84198562e53f299cca360 (patch)
tree550464457429f35ca54c4e3c1c6f014be0dbc39f /lib/mongrel/handlers.rb
parent1d211fb406d58d12b9cdaad7134dd8c3dd6a7f2b (diff)
downloadunicorn-c4fc2effca0da9ec38a84198562e53f299cca360.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@467 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel/handlers.rb')
-rw-r--r--lib/mongrel/handlers.rb20
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb
index f1ce3e4..be7860a 100644
--- a/lib/mongrel/handlers.rb
+++ b/lib/mongrel/handlers.rb
@@ -6,6 +6,7 @@
 
 require 'mongrel/stats'
 require 'zlib'
+require 'yaml'
 
 
 module Mongrel
@@ -104,21 +105,8 @@ module Mongrel
     attr_accessor :default_content_type
     attr_reader :path
 
-    MIME_TYPES = {
-      ".css"        =>  "text/css",
-      ".gif"        =>  "image/gif",
-      ".htm"        =>  "text/html",
-      ".html"       =>  "text/html",
-      ".jpeg"       =>  "image/jpeg",
-      ".jpg"        =>  "image/jpeg",
-      ".js"         =>  "text/javascript",
-      ".png"        =>  "image/png",
-      ".swf"        =>  "application/x-shockwave-flash",
-      ".txt"        =>  "text/plain",
-      ".xml"        =>  "application/xml",
-      ".rss"        =>  "application/xml+rss",
-      ".atom"       =>  "application/xml+atom",
-    }
+    MIME_TYPES_FILE = "mime_types.yml"
+    MIME_TYPES = YAML.load_file(File.join(File.dirname(__FILE__), MIME_TYPES_FILE))
 
     ONLY_HEAD_GET="Only HEAD and GET allowed.".freeze
 
@@ -127,7 +115,7 @@ module Mongrel
       @path = File.expand_path(path)
       @listing_allowed=listing_allowed
       @index_html = index_html
-      @default_content_type = "text/plain; charset=ISO-8859-1".freeze
+      @default_content_type = "application/octet-stream".freeze
     end
 
     # Checks if the given path can be served and returns the full path (or nil if not).