WEBrick MIME Types
Add some MIME Types to WEBrick's woefully short list of recognized MIME Types. (A bas 'application/octet-stream'!)
This commit is contained in:
parent
3df61e352d
commit
162a00bed4
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue