From 37a95798e1e507bf0b4ffb6a9fbe129de6366584 Mon Sep 17 00:00:00 2001 From: Krzysztof Jablonski Date: Fri, 2 Aug 2024 11:35:17 +0200 Subject: [PATCH] Compatibility with Rack 3.1 --- lib/cypress-rails/server/puma.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cypress-rails/server/puma.rb b/lib/cypress-rails/server/puma.rb index fcda07b..a90397e 100644 --- a/lib/cypress-rails/server/puma.rb +++ b/lib/cypress-rails/server/puma.rb @@ -10,7 +10,8 @@ def self.create(app, port, host) default_options = {Host: host, Port: port, Threads: "0:4", workers: 0, daemon: false} options = default_options # .merge(options) - conf = Rack::Handler::Puma.config(app, options) + puma_rack_handler = defined?(Rackup::Handler::Puma) ? Rackup::Handler::Puma : Rack::Handler::Puma + conf = puma_rack_handler.config(app, options) conf.clamp logger = (defined?(::Puma::LogWriter) ? ::Puma::LogWriter : ::Puma::Events).stdio