Closed dmitry closed 9 years ago
@dmitry I don't totally understand what's going on, but it seems that Grape Middleware is trying to convert the @app_response
object into a Rack::Response
, but as you mentioned, @app_response
is already a Rack::Response
, so the error gets raised. To me, this seems like a problem on the Grape side, because I can't find anything that grape_logging is doing to futz with the @app_response
value (that gets set from @app.call
). So to get around it:
module Grape
module Middleware
class Base
def response
return @app_response if @app_response.is_a?(Rack::Response)
super
end
end
end
end
@jgeggatt thank you for helping me. Just pushed fix to the grape.
After upgrading I see:
An issue that
response
method tries to get an array values from@app_response
, but it can't because@app_response
storesRack::Response
instead of an array.Don't know yet how to fix that issue, any suggestion can be helpful and transformed into a PR.