Appsignal::Rack::ArrayableBodyWrapper does not respond to `body`
coorasse opened this issue · 2 comments
coorasse commented
Describe the bug
In our custom middleware, we check if the body (which is an instance of Rack::BodyProxy
) responds to body
to retrieve the actual body content. After enabling the Appsignal middleware, the Rack::BodyProxy
still responds to body
, but wraps a Appsignal::Rack::ArrayableBodyWrapper
which does not. Causing the call to crash with :
/opt/ruby/vista/shared/bundle/ruby/3.3.0/gems/rack-3.1.7/lib/rack/body_proxy.rb:56:in `method_missing': undefined method `body' for an instance of Appsignal::Rack::ArrayableBodyWrapper (NoMethodError)
@body.__send__(method_name, *args, &block)
^^^^^^^^^
To Reproduce
Steps to reproduce the behavior:
- Using AppSignal for Ruby gem version 4.x
- In my app using Rails 7.1, ruby 3.3
tombruijn commented
Thanks for the report! I shipped a fix in Ruby gem 4.0.4.
coorasse commented
Amazing! Thanks!