Skip to content

Commit

Permalink
Issue #5214 - Use known content_length when in bypass write
Browse files Browse the repository at this point in the history
+ In the case of HEAD, the servlet-api response is a wrapper
  of javax.servlet.http.HttpServlet$NoBodyResponse
  We know the content_length, use it.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Aug 31, 2020
1 parent 1168713 commit eba360f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ protected boolean sendData(HttpServletRequest request,
else if (written || !(out instanceof HttpOutput))
{
// write normally
putHeaders(response, content, written ? -1 : 0);
putHeaders(response, content, content_length);
ByteBuffer buffer = content.getIndirectBuffer();
if (buffer != null)
BufferUtil.writeTo(buffer, out);
Expand Down

0 comments on commit eba360f

Please sign in to comment.