Skip to content

Commit 4066439

Browse files
authored
Fix for rackup v1.0.1 support (#2603)
### Summary This is a fix for the rackup v1.0.1 support that was re-introduced in f0c3c82 (much appreciated, thank you!). As it currently stands, I believe passenger cannot be run with rackup 1.0.1 (to keeping using rack 2) because it's incompatible with the changes made to support rackup v2.1+ in 9f11e3d. Resolves #2602. ### Testing _Before, passenger 6.0.27_ ![Screenshot 2025-04-02 at 4 41 11 PM](https://github.com/user-attachments/assets/d60a2f60-7b4b-4397-bad6-49ae94070d96) _After, this branch_ ![Screenshot 2025-04-02 at 4 42 13 PM](https://github.com/user-attachments/assets/1dde7afa-529d-4595-a9a7-69b932cbc121)
1 parent e6839e5 commit 4066439

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ruby_supportlib/phusion_passenger/rack_handler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
require 'rackup' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
4242

4343
# Rackup was removed in Rack 3, it is now a separate gem
44-
if Object.const_defined? :Rackup
44+
if Object.const_defined?(:Rackup) && ::Rackup.const_defined?(:Handler)
4545
module Rackup
4646
module Handler
4747
module PhusionPassenger
@@ -57,7 +57,7 @@ def self.default(options = {})
5757
register :passenger, PhusionPassenger
5858
end
5959
end
60-
elsif Object.const_defined?(:Rack) && Rack.release < '3'
60+
elsif Object.const_defined?(:Rack) && ::Rack.release < '3'
6161
module Rack
6262
module Handler
6363
module PhusionPassenger

0 commit comments

Comments
 (0)