H2C Upgrade fails on chunked encoding
Author: NilsRenaudCreated Sep 4, 2026Updated Sep 16, 2026
Labelsbug
Proposal
When an HTTP Client sends a message such as:
> POST / HTTP/1.1
> Host: localhost:8082
> User-Agent: curl/8.5.0
> Accept: */*
> Connection: Upgrade, HTTP2-Settings
> Upgrade: h2c
> HTTP2-Settings: AAMAAABkAAQAoAAAAAIAAAAA
> transfer-encoding: chunked
> Content-Type: application/x-www-form-urlencodedThen WireMock (simply java -jar wiremock-standalone-3.13.2.jar) , returns an Upgrade response then kills the HTTP/2 stream instead of returning a valid HTTP response:
< HTTP/1.1 101 Switching Protocols
< Upgrade: h2c
< Connection: Upgrade
* Received 101, Switching to HTTP/2
* HTTP/2 stream 1 was not closed cleanly: CANCEL (err 8)
* Connection #0 to host localhost left intact
curl: (92) HTTP/2 stream 1 was not closed cleanly: CANCEL (err 8)Tested with WireMock 3.12.0 and latest (3.13.2).
FYI, I've checked the CURL command against a Vert.x server, configured as below, and the request works well:
Vertx.vertx()
.createHttpServer(new HttpServerOptions().setHttp2ClearTextEnabled(true))
.requestHandler(request -> request.response().end("OK"))
.listen()
.blockingGet();Reproduction steps
Just run curl -v --http2 -d "aaa" -H "transfer-encoding: chunked" http://localhost:8082/ with a WireMock instance running on 8082.
References
No response
Source: wiremock/wiremock