Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ByteArrayResponseWrapper should override more methods to control response commit state #114

Open
joakime opened this issue Jul 22, 2016 · 0 comments

Comments

@joakime
Copy link

joakime commented Jul 22, 2016

The current ByteArrayResponseWrapper makes a bad assumption that .getWriter() is only ever used when calling a filter chain from the DandelionFilter.

The ByteArrayResponseWrapper should also override the following methods and either prevent them from going down to the wrapped delegate, or toss an exception if attempted to be used (indicating bad runtime assumptions in the filter chain)

  • sendError() - this commits the response and closes the connection
  • sendRedirect() - again, this commits the response, and you don't support it using servlet spec, you do it yourself
  • getResponse() - downstream shouldn't be allowed to unwrap to a base response object
  • getOutputStream() - use of this should not be allowed
  • flushBuffer() - this commits the response and should not be allowed when the DandelionFilter is being used
  • reset() - either implement this or declare it unsupported
  • resetBuffer() - either implement this or declare it unsupported
@joakime joakime changed the title ByteArrayResponseWrapper should override more method to control response commit state ByteArrayResponseWrapper should override more methods to control response commit state Jul 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant