Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Access response body in after filter (or make clear in documentation it's not possible) #168

niko opened this Issue Jan 23, 2011 · 2 comments


None yet
2 participants

niko commented Jan 23, 2011

Today I tried to access the body of the response in an after filter. The documentation gives the impression this should be possible:

After filter are evaluated after each request within the same context and can also modify the request and response.

It turns out I'm not the only one trying to do that:

The responses to the questions vary, too: For some it just works, other just says it's not possible.

I used the released gem version 1.1.2 and the latest master checkout as of 2011/1/23 (c1eb806) and the body is just empty in the after filter.

I think it would be great, if one could get hold of the body in an after filter. If that's not possible it would be nice if the documentation would state this fact (don't know if this doubles issue 146 https://github.com/sinatra/sinatra/issuesearch?state=open&q=body#issue/146).

Thanks, Niko.


rkh commented Feb 17, 2011

Document accessing response body in after filter. Closed by 380c312.

niko commented Feb 18, 2011

Thanks. Makes it perfectly clear. :)

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment