From 162a00bed46ff411fd15ea6275e599058fb246f0 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Tue, 29 May 2007 22:39:35 -0500 Subject: [PATCH] WEBrick MIME Types Add some MIME Types to WEBrick's woefully short list of recognized MIME Types. (A bas 'application/octet-stream'!) --- script/server | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/server b/script/server index 27a7989a..926e764c 100755 --- a/script/server +++ b/script/server @@ -1,6 +1,7 @@ #!/usr/bin/env ruby require 'webrick' +require 'webrick/httputils' require 'optparse' OPTIONS = { @@ -8,7 +9,13 @@ OPTIONS = { :ip => "0.0.0.0", :environment => "production", :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"), - :server_type => WEBrick::SimpleServer + :server_type => WEBrick::SimpleServer, + :mime_types => WEBrick::HTTPUtils::DefaultMimeTypes.merge({ + 'js' => 'application/x-javascript', + 'svg' => 'application/svg+xml', + 'tex' => 'application/x-tex', + 'pdf' => 'application/pdf', + 'avi' => 'video/x-msvideo' }) } ARGV.options do |opts|