Skip to content

Commit

Permalink
Revert "Update Thin handler to better handle more options"
Browse files Browse the repository at this point in the history
This reverts commit 371bd58.

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
  • Loading branch information
jeremyevans authored and ioquatix committed Feb 10, 2020
1 parent 961d976 commit 5c121dd
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions lib/rack/handler/thin.rb
Expand Up @@ -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
Expand Down

0 comments on commit 5c121dd

Please sign in to comment.