Skip to content

Instantly share code, notes, and snippets.

@vrnsky
Created January 18, 2021 04:44
Show Gist options
  • Save vrnsky/2c13190017d7d23e205a6a69ed877e99 to your computer and use it in GitHub Desktop.
Save vrnsky/2c13190017d7d23e205a6a69ed877e99 to your computer and use it in GitHub Desktop.
private static ContentCachingRequestWrapper wrapRequest(HttpServletRequest httpServletRequest) {
if (httpServletRequest instanceof ContentCachingRequestWrapper) {
return (ContentCachingRequestWrapper) httpServletRequest;
} else {
return new ContentCachingRequestWrapper(httpServletRequest);
}
}
private static ContentCachingResponseWrapper wrapResponse(HttpServletResponse httpServletResponse) {
if (httpServletResponse instanceof ContentCachingResponseWrapper) {
return (ContentCachingResponseWrapper) httpServletResponse;
} else {
return new ContentCachingResponseWrapper(httpServletResponse);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment