Commit 8e19f5ba authored by Tom Evans's avatar Tom Evans

OF-908: Avoid chunked encoding for BOSH

Fixes the alternate (synchronous) write to the HTTP response output
stream.
parent 70de10f8
......@@ -299,9 +299,9 @@ public class HttpBindServlet extends HttpServlet {
if (async) {
response.getOutputStream().setWriteListener(new WriteListenerImpl(context, byteContent));
} else {
// BOSH communication should not have Chunked encoding. Ensure that the
// buffer can hold the entire response to prevent chunking.
context.getResponse().setBufferSize(byteContent.length);
// BOSH communication should not use Chunked encoding.
// This is prevented by explicitly setting the Content-Length header.
context.getResponse().setContentLength(byteContent.length);
context.getResponse().getOutputStream().write(byteContent);
context.getResponse().getOutputStream().flush();
context.complete();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment