Closed javierhonduco closed 9 years ago
Sounds like a bug. If present
is a rails ism and it should be removed from the code. I think it is. Oops.
Do you think that unless body.empty? or body.nil?
would do the trick?
Should be a very simple PR if you want to try. Otherwise I'll try to get to is. Just grep the code for .present?
@Javier yes!
But you need to check nil first, then check empty, because nil does not respond to empty.
This is now fixed in master HEAD. Will close issue when I push a new release to rubygems.org
Released 0.5.30 with this fix.
On a Rails 4.2.0 app, I get this :
undefined method `empty?' for #<ActionDispatch::Response::RackBody:0x0000011158e578>
rack-insight (0.5.30) lib/rack/insight/enable-button.rb:16:in `call'
Is it related ?
@jlecour
Oh, interesting. I had someone else reporting an empty?
bug as well. No, it's not related to this bug. Apparently what worked in Rails 3, and I think 4.0, no longer works in 4.2 in the Middleware. This should be a new issue.
Running rack-insight as a Sinatra middleware yields the following error:
Wondering if I'm doing something wrong or if it's a bug. Cheers,