summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-02-09 08:10:48 -0800
committerJeremy Evans <code@jeremyevans.net>2020-02-09 08:10:48 -0800
commitb9262d670aee8e20fba19ce18e961d6680d194b6 (patch)
tree9ee5bf331245ad9b81ef49fb82b74c565c0e8002
parent9b211e760145e768aeab199bb7e7e3a7b89b84ab (diff)
downloadrack-b9262d670aee8e20fba19ce18e961d6680d194b6.tar.gz
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
-rw-r--r--lib/rack/handler/thin.rb22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/rack/handler/thin.rb b/lib/rack/handler/thin.rb
index d1629835..393a6e98 100644
--- a/lib/rack/handler/thin.rb
+++ b/lib/rack/handler/thin.rb
@@ -12,20 +12,14 @@ module Rack
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