Skip to content

Commit

Permalink
Gracefully handle Rack not accepting CLI options (#2630)
Browse files Browse the repository at this point in the history
In
rack/rack@b95cb72#diff-79892c6315a7f9c02489803e95ce828a8a32759b9f8f196aa98e6826eb562e55R96,
Rack removed the ability to pass options from the command line. It now
fails when you try to do that, and no longer exposes them from
`Builder.load_file`. Puma shouldn't fail when this happens.

This commit falls back to an empty object when Rack does not pass
options back from `Builder.load_file`.
  • Loading branch information
seangoedecke committed May 20, 2021
1 parent 04e4b1a commit f9e9102
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puma/configuration.rb
Expand Up @@ -343,6 +343,8 @@ def load_rackup
raise "Missing rackup file '#{rackup}'" unless File.exist?(rackup)

rack_app, rack_options = rack_builder.parse_file(rackup)
rack_options = rack_options || {}

@options.file_options.merge!(rack_options)

config_ru_binds = []
Expand Down

0 comments on commit f9e9102

Please sign in to comment.