Skip to content
This repository
Browse code

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

…n stylesheets and javascripts, somehow)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2251 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 1fb8ba7592c6a231bac62e1623645fd18b1eb951 1 parent 3e7b597
Jamis Buck jamis authored

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. +6 5 railties/lib/webrick_server.rb
11 railties/lib/webrick_server.rb
@@ -46,11 +46,12 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
46 46 def self.dispatch(options = {})
47 47 Socket.do_not_reverse_lookup = true # patch for OS X
48 48
49   - server = WEBrick::HTTPServer.new(:Port => options[:port].to_i,
50   - :ServerType => options[:server_type],
51   - :BindAddress => options[:ip],
52   - :MimeTypes => options[:mime_types]
53   - )
  49 + params = { :Port => options[:port].to_i,
  50 + :ServerType => options[:server_type],
  51 + :BindAddress => options[:ip] }
  52 + params[:MimeTypes] = options[:mime_types] if options[:mime_types]
  53 +
  54 + server = WEBrick::HTTPServer.new(params)
54 55 server.mount('/', DispatchServlet, options)
55 56
56 57 trap("INT") { server.shutdown }

0 comments on commit 1fb8ba7

Please sign in to comment.
Something went wrong with that request. Please try again.