From 5c121dd6853fa231d1b1253b6e8e7cfc927791ca Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Sun, 9 Feb 2020 08:10:48 -0800 Subject: [PATCH] Revert "Update Thin handler to better handle more options" This reverts commit 371bd586d188d358875676bc37348db9a0bf7a07. This broke the thin adapter. Reverting it restores the previous behavior. This was added to make SSL configuration easier. Users who want to do that should use the thin executable instead of the rackup executable. Fixes #1583 --- lib/rack/handler/thin.rb | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/rack/handler/thin.rb b/lib/rack/handler/thin.rb index d16298355..393a6e986 100644 --- a/lib/rack/handler/thin.rb +++ b/lib/rack/handler/thin.rb @@ -12,20 +12,14 @@ def self.run(app, **options) environment = ENV['RACK_ENV'] || 'development' default_host = environment == 'development' ? 'localhost' : '0.0.0.0' - if block_given? - host = options.delete(:Host) || default_host - port = options.delete(:Port) || 8080 - args = [host, port, app, options] - # Thin versions below 0.8.0 do not support additional options - args.pop if ::Thin::VERSION::MAJOR < 1 && ::Thin::VERSION::MINOR < 8 - server = ::Thin::Server.new(*args) - yield server - server.start - else - options[:address] = options[:Host] || default_host - options[:port] = options[:Port] || 8080 - ::Thin::Controllers::Controller.new(options).start - end + host = options.delete(:Host) || default_host + port = options.delete(:Port) || 8080 + args = [host, port, app, options] + # Thin versions below 0.8.0 do not support additional options + args.pop if ::Thin::VERSION::MAJOR < 1 && ::Thin::VERSION::MINOR < 8 + server = ::Thin::Server.new(*args) + yield server if block_given? + server.start end def self.valid_options