Skip to content

Commit

Permalink
Made Passenger more resiliant to Rack bugs. Closes GH-2150.
Browse files Browse the repository at this point in the history
Rack keeps trying to call eof? on objects that don’t have that method. So implement it for the sake of not having to deal with this anymore.
  • Loading branch information
CamJN committed Feb 15, 2019
1 parent 7d4251b commit 9464a70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Expand Up @@ -4,6 +4,8 @@ Release 6.0.2 (Not released yet)
* Allow compilation to work when Apple messed up their system ruby headers.
* Only try to read pid 1's /proc files as root, in container detection. Closes GH-2168.
* Add an option to disable prefixing application logs with "App PID stdout": `PassengerDisableLogPrefix` (Apache) / `passenger_disable_log_prefix` (Nginx). Closes GH-1915
* Made Passenger more resiliant to Rack bugs. Closes GH-2150.


Release 6.0.1
-------------
Expand Down
6 changes: 6 additions & 0 deletions src/ruby_supportlib/phusion_passenger/utils/tee_input.rb
Expand Up @@ -191,6 +191,12 @@ def each
self # Rack does not specify what the return value is here
end

# Rack repeatedly introduces bugs that rely on this method existing
# https://github.com/rack/rack/pull/1201
def eof?
socket_drained?
end

private

def socket_drained?
Expand Down

0 comments on commit 9464a70

Please sign in to comment.