]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: quic: test H3 request without content-length
authorAndrea Cocito <andrea@cocito.eu>
Tue, 23 Jun 2026 09:44:39 +0000 (11:44 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Jun 2026 06:53:04 +0000 (08:53 +0200)
Add a QUIC regression test for an HTTP/3 request body without
Content-Length forwarded to an HTTP/1 backend.

The client side sends a chunked HTTP/1 request to a first HAProxy
instance, which forwards it to a second HAProxy instance over QUIC/H3.
The second instance then forwards it to a plain HTTP/1 server. This
exercises the H3 frontend to H1 backend path with an unknown request
body length.

reg-tests/quic/h3_unknown_length_req.vtc [new file with mode: 0644]

diff --git a/reg-tests/quic/h3_unknown_length_req.vtc b/reg-tests/quic/h3_unknown_length_req.vtc
new file mode 100644 (file)
index 0000000..314fd8c
--- /dev/null
@@ -0,0 +1,60 @@
+varnishtest "HTTP/3 request body without content-length to H1 backend"
+
+feature ignore_unknown_macro
+
+# QUIC backend are not supported with USE_QUIC_OPENSSL_COMPAT
+feature cmd "$HAPROXY_PROGRAM -cc 'feature(QUIC) && !feature(QUIC_OPENSSL_COMPAT) && !feature(OPENSSL_WOLFSSL)'"
+
+server s1 {
+       rxreq
+       expect req.method == "POST"
+       expect req.bodylen == 50000
+       txresp
+} -start
+
+haproxy ha_h3srv -conf {
+       global
+               .if feature(THREAD)
+                       thread-groups 1
+               .endif
+
+       defaults
+               mode http
+               timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout client  "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout server  "${HAPROXY_TEST_TIMEOUT-5s}"
+
+       listen h3_fe
+               bind "quic+fd@${fe_quic}" ssl crt ${testdir}/certs/common.pem
+               server srv ${s1_addr}:${s1_port}
+} -start
+
+haproxy ha_h3cli -conf {
+       global
+               expose-experimental-directives
+               .if feature(THREAD)
+                       thread-groups 1
+               .endif
+
+       defaults
+               mode http
+               timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout client  "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout server  "${HAPROXY_TEST_TIMEOUT-5s}"
+
+       frontend fe
+               bind "fd@${fe}"
+               default_backend be_h3
+
+       backend be_h3
+               server h3 quic4@${ha_h3srv_fe_quic_addr}:${ha_h3srv_fe_quic_port} ssl verify none
+} -start
+
+client c1 -connect ${ha_h3cli_fe_sock} {
+       txreq -method POST -hdr "Transfer-Encoding: chunked"
+       chunkedlen 25000
+       chunkedlen 25000
+       chunkedlen 0
+       rxresp
+       expect resp.status == 200
+} -run