WEBrick MIME Types

Add some MIME Types to WEBrick's woefully short list of recognized MIME Types.
(A bas 'application/octet-stream'!)
master
Jacques Distler 2007-05-29 22:39:35 -05:00
parent 3df61e352d
commit 162a00bed4
1 changed files with 8 additions and 1 deletions

View File

@ -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|