Issue: SPR-11644 (cherry picked from commit 3a96f16)
3a96f16
@ -249,7 +249,17 @@ public class ResourceHttpRequestHandler extends WebContentGenerator implements H
* @throws IOException in case of errors while writing the content
*/
protected void writeContent(HttpServletResponse response, Resource resource) throws IOException {
StreamUtils.copy(resource.getInputStream(), response.getOutputStream());
InputStream in = resource.getInputStream();
try {
StreamUtils.copy(in, response.getOutputStream());
}
finally {
in.close();
catch (IOException ex) {