eclipse-ee4j / eclipse-ee4j/jersey

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

Open
#6,045 12 comments 0 reactions 1 assignee Claimed by @jbescos View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.