Skip to content

Commit

Permalink
Fix for issue #1657. Include ActionDispatch::Static when running WEBr…
Browse files Browse the repository at this point in the history
…ick in production mode
  • Loading branch information
TomTriple committed Jun 14, 2011
1 parent deff597 commit 55e9cbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion railties/lib/rails/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def default_middleware_stack
middleware.use ::Rack::SSL
end

if config.serve_static_assets
running_webrick = Rails::Info.properties.value_for("Server") == ActiveSupport::Inflector.demodulize(::Rack::Handler::WEBrick)
if config.serve_static_assets || running_webrick && Rails.env == "production"
middleware.use ::ActionDispatch::Static, paths["public"].first, config.static_cache_control
end

Expand Down
1 change: 1 addition & 0 deletions railties/lib/rails/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
# otherwise the --environment option given to the server won't propagate.
require APP_PATH
Dir.chdir(Rails.application.root)
Rails::Info.property("Server", ActiveSupport::Inflector.demodulize(server.server))
server.start
}

Expand Down

0 comments on commit 55e9cbc

Please sign in to comment.