Skip to content

Commit

Permalink
Merge pull request #163 from krzysztofjablonski/patch-1
Browse files Browse the repository at this point in the history
Add compatibility with Rack 3.1
  • Loading branch information
rosston authored Sep 6, 2024
2 parents 402af0e + 7074329 commit ba5ba30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ GEM
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.9)
rack (3.1.7)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
Expand Down
2 changes: 1 addition & 1 deletion example/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ GEM
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.9)
rack (3.1.7)
rack-proxy (0.7.7)
rack
rack-session (2.0.0)
Expand Down
3 changes: 2 additions & 1 deletion lib/cypress-rails/server/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ba5ba30

Please sign in to comment.