Skip to content

Fold h2c upgrade header names with Locale.ROOT - #6460

Open
sharanggupta wants to merge 1 commit into
eclipse-vertx:masterfrom
sharanggupta:h2c-upgrade-header-names-locale-root
Open

sharanggupta wants to merge 1 commit into
eclipse-vertx:masterfrom
sharanggupta:h2c-upgrade-header-names-locale-root

Conversation

@sharanggupta

Copy link
Copy Markdown

Fixes #6459.

Http1xUpgradeToH2CHandler lower-cased the HTTP/1.1 header names with the JVM default locale when building the HTTP/2 headers for an h2c upgrade, so under a Turkish default locale If-None-Match became ıf-none-match and Netty rejected the synthetic HTTP/2 request after 101 Switching Protocols (connection error, client hang). Use Locale.ROOT, and add a regression test that upgrades with If-None-Match and X-Request-ID under a tr-TR default locale (restored in finally). The same one-token change applies to 4.x.

Http1xUpgradeToH2CHandler lower-cased the HTTP/1.1 header names with
String.toLowerCase(), which follows the JVM default locale, when
building the HTTP/2 headers for an h2c upgrade. Under a Turkish default
locale "If-None-Match" became "ıf-none-match" (dotless ı), Netty
rejected the synthetic HTTP/2 request with "invalid header name" after
101 Switching Protocols had been written, and the client hung.

Use Locale.ROOT and add a regression test that performs an h2c upgrade
with If-None-Match and X-Request-ID headers under a tr-TR default
locale.

Assisted-by: Anthropic Claude (Fable 5.1)
Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
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.

h2c upgrade lower-cases HTTP/1.1 header names with the JVM default locale → PROTOCOL_ERROR under Turkish locale

1 participant