mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
Add http header connection close (#2432)
This commit is contained in:
@@ -125,6 +125,7 @@ public class HttpRequestHandler extends SimpleChannelInboundHandler<FullHttpRequ
|
||||
// try to add content-length header for DefaultFullHttpResponse
|
||||
if (!HttpUtil.isTransferEncodingChunked(response)
|
||||
&& response instanceof DefaultFullHttpResponse) {
|
||||
response.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE);
|
||||
response.headers().set(HttpHeaderNames.CONTENT_LENGTH,
|
||||
((DefaultFullHttpResponse) response).content().readableBytes());
|
||||
return ctx.writeAndFlush(response);
|
||||
|
||||
Reference in New Issue
Block a user