Skip to content

Commit

Permalink
fix head content length
Browse files Browse the repository at this point in the history
  • Loading branch information
SurfaceS committed Jul 16, 2024
1 parent 782df88 commit 620a8cb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ private static void sendResponse(HttpServletRequest req, HttpServletResponse res
OutputStream os = new BufferedOutputStream(resp.getOutputStream(), BUFFER_SIZE);
copyStreamAsync(inputStream, os, async);
} else {
if (HEAD.equalsIgnoreCase(req.getMethod()) && contentLength < 1) {
resp.flushBuffer();
}
try {
inputStream.close();
} catch (IOException ioe) {
Expand Down

0 comments on commit 620a8cb

Please sign in to comment.