Handle decoration of HttpServletRequest and HttpServletResponse in filter chain
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 1.7k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
Decoration via HttpServletRequestWrapper and HttpServletResponseWrapper is a very common pattern to change in the filter chain how HttpServletRequest and HttpServletResponse instances work. However, if decoration is performed by a filter that appears in the chain after the GuiceFilter, Guice will inject the un-decorated request. Since GuiceFilter is suggested to be the very filter in the chain ("Start by placing GuiceFilter at the top of your .web.xml file", https://github.com/google/guice/wiki/Servlets ), this leads to a very confusing situation. As long as the decoration process does not require injection, it can be worked around by moving the decorating filters before the GuiceFilter. If, instead, injection is required, then we are screwed :-) Ideally, it should be possible to update in the filter chain the request and response stored in the local context of the GuiceFilter with some API.
Contributor guide
Assessment
This issue has not been assessed yet.