Skip to content
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

#close not called on response body #26

Closed
zbristow opened this issue Nov 20, 2021 · 1 comment · Fixed by #27
Closed

#close not called on response body #26

zbristow opened this issue Nov 20, 2021 · 1 comment · Fixed by #27

Comments

@zbristow
Copy link
Contributor

It looks like format_body is not calling close on the response body after iterating over it. I found this when trying to use Rack::CommonLogger with my app and not seeing the expected log entries show up in my CloudWatch logs. It turns out this middleware relies on body.close to be called to emit a log message.

Since this is part of the Rack spec to call close if the body responds to it, can format_body be updated to do this? I was able to get this middleware working after patching locally, so I can submit a PR with a fix if you'd like.

@logandk
Copy link
Owner

logandk commented Nov 22, 2021

@zbristow Thanks for reporting, I'd appreciate a PR, since you already patched locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants