Issue #5214 - Use known content_length when in bypass write

+ 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>
This commit is contained in:
Joakim Erdfelt 2020-08-31 09:43:04 -05:00
parent 116871362b
commit eba360f662
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 1 additions and 1 deletions

View File

@ -677,7 +677,7 @@ public class ResourceService
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);