Skip to content

jersey-netty-connector v2.47 : Connector is returning 200 OK when decoded result in HttpResponse contains TooLongHttpHeaderException #6045

@sxsubram

Description

@sxsubram

jersey-netty-connector v2.47
JDK 21

In jersey-netty-connector client configuration the following properties are set -
defaultConfig.property(NettyClientProperties.MAX_HEADER_SIZE, 8192 * 2);
defaultConfig.property(NettyClientProperties.MAX_INITIAL_LINE_LENGTH, 8192 * 2);

In the test the server is sending a header that exceeds the MAX_HEADER_SIZE.
invocationBuilder.header("X-LARGE-HEADER", largeHeader);
invocationBuilder.header("X-MY-HEADER", "foo");

When JerseyClientHandler reads the response I see the following in the debugger.

DefaultHttpResponse(decodeResult: failure(io.netty.handler.codec.http.TooLongHttpHeaderException: HTTP header is larger than 16384 bytes.), version: HTTP/1.1)
HTTP/1.1 200 OK
Date: Tue, 09 Dec 2025 22:05:37 GMT
Content-Type: application/json
Content-Length: 22

Even though the netty layer creates TooLongHttpHeaderException, this is not captured in the response processing. The future returned the client does not have the required headers causing downstream processing exceptions.

Image Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions