Skip to content
Browse files

add Rack::Lock for webrick

  • Loading branch information...
1 parent 5d416b9 commit da3d28ea33a7e418c99e89aa6b4028ba054f1f39 @tenderlove tenderlove committed with josevalim Aug 21, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 railties/lib/rails/commands/server.rb
View
9 railties/lib/rails/commands/server.rb
@@ -87,6 +87,15 @@ def middleware
middlewares = []
middlewares << [Rails::Rack::Debugger] if options[:debugger]
middlewares << [::Rack::ContentLength]
+
+ # FIXME: add Rack::Lock in the case people are using webrick.
+ # This is to remain backwards compatible for those who are
+ # running webrick in production. We should consider removing this
+ # in development.
+ if server.name == 'Rack::Handler::WEBrick'
+ middlewares << [::Rack::Lock]
+ end
+
Hash.new(middlewares)
end

0 comments on commit da3d28e

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