提交 1fb8ba75 编写于 作者: J Jamis Buck

Don't set the :MimeTypes option if it is nil (causes routing errors on...

Don't set the :MimeTypes option if it is nil (causes routing errors on stylesheets and javascripts, somehow)


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2251 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 3e7b597f
......@@ -46,11 +46,12 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
def self.dispatch(options = {})
Socket.do_not_reverse_lookup = true # patch for OS X
server = WEBrick::HTTPServer.new(:Port => options[:port].to_i,
:ServerType => options[:server_type],
:BindAddress => options[:ip],
:MimeTypes => options[:mime_types]
)
params = { :Port => options[:port].to_i,
:ServerType => options[:server_type],
:BindAddress => options[:ip] }
params[:MimeTypes] = options[:mime_types] if options[:mime_types]
server = WEBrick::HTTPServer.new(params)
server.mount('/', DispatchServlet, options)
trap("INT") { server.shutdown }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册