Only default puma options to queue_requests: false if ssl is specified
This commit is contained in:
parent
66c1583568
commit
eb8fe55b99
|
@ -23,7 +23,10 @@ Capybara.register_server :puma do |app, port, host, **options|
|
||||||
# If we just run the Puma Rack handler it installs signal handlers which prevent us from being able to interrupt tests.
|
# If we just run the Puma Rack handler it installs signal handlers which prevent us from being able to interrupt tests.
|
||||||
# Therefore construct and run the Server instance ourselves.
|
# Therefore construct and run the Server instance ourselves.
|
||||||
# Rack::Handler::Puma.run(app, { Host: host, Port: port, Threads: "0:4", workers: 0, daemon: false }.merge(options))
|
# Rack::Handler::Puma.run(app, { Host: host, Port: port, Threads: "0:4", workers: 0, daemon: false }.merge(options))
|
||||||
options = { Host: host, Port: port, Threads: '0:4', workers: 0, daemon: false, queue_requests: false }.merge(options)
|
default_options = { Host: host, Port: port, Threads: '0:4', workers: 0, daemon: false, queue_requests: false }
|
||||||
|
default_options[:queue_requests] = false if options[:Host]&.start_with?('ssl://')
|
||||||
|
options = default_options.merge(options)
|
||||||
|
|
||||||
conf = Rack::Handler::Puma.config(app, options)
|
conf = Rack::Handler::Puma.config(app, options)
|
||||||
events = conf.options[:Silent] ? ::Puma::Events.strings : ::Puma::Events.stdio
|
events = conf.options[:Silent] ? ::Puma::Events.strings : ::Puma::Events.stdio
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue