Skip to content

Commit 1bacbc5

Browse files
committed
chore: only send keep-alive header if not disabled by client
1 parent 7664a9f commit 1bacbc5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

web-impl-netty/src/main/java/eu/cloudnetservice/ext/rest/netty/NettyHttpServerHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ private void handleMessage(
253253
netty.headers().set(HttpHeaders.DATE, currentDate);
254254

255255
// append the keep-alive information as headers, if needed
256-
var keepAlive = !context.closeAfter;
256+
var keepAlive = !context.closeAfter && HttpUtil.isKeepAlive(httpRequest);
257257
HttpUtil.setKeepAlive(netty, keepAlive);
258258
if (keepAlive) {
259259
var keepAliveTimeout = NettyHttpServerInitializer.MAX_CONNECTION_IDLE_TIME.toSeconds();

0 commit comments

Comments
 (0)