From 7433247c8e701ea0d7d032d71412e0b4145772b4 Mon Sep 17 00:00:00 2001 From: Thomas Kountis Date: Wed, 9 Dec 2020 18:42:36 +0000 Subject: [PATCH] Relax can-add-content-length check --- .../src/main/java/io/servicetalk/http/netty/HeaderUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/HeaderUtils.java b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/HeaderUtils.java index 2cad77bb06..ba3eabeefc 100644 --- a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/HeaderUtils.java +++ b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/HeaderUtils.java @@ -113,9 +113,7 @@ static boolean canAddResponseTransferEncodingProtocol(final int statusCode, } private static boolean canAddContentLength(final HttpMetaData metadata) { - // TODO once this bug is addressed (https://github.com/apple/servicetalk/pull/1213) - // we should relax the check here, remove content-encoding clause - return !hasContentHeaders(metadata.headers()) && !hasContentEncoding(metadata.headers()) && + return !hasContentHeaders(metadata.headers()) && isSafeToAggregate(metadata) && !mayHaveTrailers(metadata); }