Skip to content

Conversation

@sanjomo
Copy link
Contributor

@sanjomo sanjomo commented Dec 9, 2025

Motivation:
The change in #15909 is merged but not yet released. While working on HTTP/3 connections I noticed a logical issue: when an unknown settings key is received, the current implementation returns a value, which causes Http3FrameCodec to treat it as an error (because settings.put(key, value) returns the previous value for known keys and null for new ones). For unknown keys we should ignore them, so we now always return null to achieve the expected behavior.

Modification:

  • settings.put(key, value) now returns null for unknown keys (non null triggers an error in Http3FrameCodec decoding).

  • Added unit tests to verify this.

Note: Http3CodecTest didn’t catch the issue previously because it used frames produced by the same put logic, so both encoding and decoding behaved consistently and the issue was hidden.

unknown identifiers should be ignored, but if we return value , then http3codec considers it as duplicate header and throws error, we can return null but not set inside the setting map to ignore
@normanmaurer normanmaurer added this to the 4.2.8.Final milestone Dec 9, 2025
@normanmaurer normanmaurer merged commit 640b6b7 into netty:4.2 Dec 9, 2025
20 of 21 checks passed
normanmaurer added a commit that referenced this pull request Dec 9, 2025
**Motivation:**
The change in
[https://github.com/netty/netty/pull/15909](https://github.com/netty/netty/pull/15909)
is merged but not yet released. While working on HTTP/3 connections I
noticed a logical issue: when an unknown settings key is received, the
current implementation returns a value, which causes Http3FrameCodec to
treat it as an error (because settings.put(key, value) returns the
previous value for known keys and null for new ones). For unknown keys
we should ignore them, so we now always return null to achieve the
expected behavior.

**Modification:**
* [x] settings.put(key, value) now returns null for unknown keys (non
null triggers an error in Http3FrameCodec decoding).

* [x] Added unit tests to verify this. 

> Note: Http3CodecTest didn’t catch the issue previously because it used
frames produced by the same put logic, so both encoding and decoding
behaved consistently and the issue was hidden.

---------

Co-authored-by: Norman Maurer <[email protected]>
normanmaurer added a commit that referenced this pull request Dec 10, 2025
…16002)

**Motivation:**
The change in

[https://github.com/netty/netty/pull/15909](https://github.com/netty/netty/pull/15909)
is merged but not yet released. While working on HTTP/3 connections I
noticed a logical issue: when an unknown settings key is received, the
current implementation returns a value, which causes Http3FrameCodec to
treat it as an error (because settings.put(key, value) returns the
previous value for known keys and null for new ones). For unknown keys
we should ignore them, so we now always return null to achieve the
expected behavior.

**Modification:**
* [x] settings.put(key, value) now returns null for unknown keys (non
null triggers an error in Http3FrameCodec decoding).

* [x] Added unit tests to verify this. 

> Note: Http3CodecTest didn’t catch the issue previously because it used
frames produced by the same put logic, so both encoding and decoding
behaved consistently and the issue was hidden.

Co-authored-by: sanjomo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants