use of com.predic8.membrane.core.http.PlainBodyTransferrer in project service-proxy by membrane.
the class HttpServletHandler method writeResponse.
@SuppressWarnings("deprecation")
protected void writeResponse(Response res) throws Exception {
response.setStatus(res.getStatusCode(), res.getStatusMessage());
for (HeaderField header : res.getHeader().getAllHeaderFields()) {
if (header.getHeaderName().equals(Header.TRANSFER_ENCODING))
continue;
response.addHeader(header.getHeaderName().toString(), header.getValue());
}
ServletOutputStream out = response.getOutputStream();
res.getBody().write(new PlainBodyTransferrer(out));
out.flush();
response.flushBuffer();
exchange.setTimeResSent(System.currentTimeMillis());
exchange.collectStatistics();
}
Aggregations