From f0767b0e1f1d18bfe77fbac2b3202b0595432a73 Mon Sep 17 00:00:00 2001 From: Richard Schneeman Date: Fri, 12 May 2017 15:28:59 -0500 Subject: [PATCH] Fix rack handler logic (#1290) There was a mistake previously where if both host and port were passed in as "default" they would take precedence of any values from the puma config "file". We can fix this by checking to make sure there were values explicitly passed before setting the config. --- lib/rack/handler/puma.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/rack/handler/puma.rb b/lib/rack/handler/puma.rb index b493aead..ef1a2a7f 100644 --- a/lib/rack/handler/puma.rb +++ b/lib/rack/handler/puma.rb @@ -42,10 +42,12 @@ module Rack user_config.threads min, max end - host = options[:Host] || default_options[:Host] - port = options[:Port] || default_options[:Port] + if options[:Host] || options[:Port] + host = options[:Host] || default_options[:Host] + port = options[:Port] || default_options[:Port] + self.set_host_port_to_config(host, port, user_config) + end - self.set_host_port_to_config(host, port, user_config) self.set_host_port_to_config(default_options[:Host], default_options[:Port], default_config) user_config.app app