-
-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return a Rack::BodyProxy
from the Rails::Rack::Logger
monkey patch
#333
Conversation
This should return the same object that Rails is returning. See https://github.com/rails/rails/blob/8d1b8e870c1c42859132c8d51ceff0ac72cbe34b/railties/lib/rails/rack/logger.rb#L38
@ghiculescu could you rebase on master and add an entry to the changelog? |
Done, did you also want commits squashed or are you fine to use the github squasher? |
@ghiculescu looks like CI is failing, could you take another look? No worries about squashing—I'll let the GH merge tool handle that. |
I'm not sure, but it looks like Rack::BodyProxy#close always calls block in ensure part. But in this PR the block is Check the original implementation in Rails — https://github.com/rails/rails/blob/v6.1.4.4/railties/lib/rails/rack/logger.rb#L38. They use block. Also, I checked all gems in my gemset and found out that ALL of them use block. P.S. I've copied block logic from original Rails implementation and it solves my issue — Salesap@d7ec60e |
@sigra interesting! Mind submitting a PR to change our use of |
This should return the same object that Rails is returning. See https://github.com/rails/rails/blob/8d1b8e870c1c42859132c8d51ceff0ac72cbe34b/railties/lib/rails/rack/logger.rb#L38