You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a feature to add linting in Grape by adding Rack::Lint in the stack. It works well but I'm encountering a Rack::Lint::LintError: Response body is already closed when a Grape API is mounted in a Rails app.
When calling it, Rails's middlewares stack will deal with a Rack::Lint::Wrapper body instead of the real one. This ain't the issue but if we look at Rack::Etag, it might call body.to_ary. Indeed, the to_ary function will be the one in Rack::Lint::Wrapper and it will close the body. Unfortunately, when calling each on it, it will raise a Rack::Lint::LintError even though our original linting was valid.
I've looked into Rack::Lint and somehow, it was setting@closed = false when calling each in Rack 2, but this is not the case anymore.
I've open an issue on our side if you want to take a look at my example.