From: Stefan Eissing Date: Mon, 13 Feb 2023 13:22:37 +0000 (+0100) Subject: tests: add tests for HTTP/2 and HTTP/3 to verify the header API X-Git-Tag: curl-7_88_0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c74bad29fd6afb60a2513835ac660ac7ace38874;p=thirdparty%2Fcurl.git tests: add tests for HTTP/2 and HTTP/3 to verify the header API Test 2403 and 2503 check "header_json" output and therefore use of header-api Closes #10495 --- diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 762c41ca24..97fdabcfa0 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -244,9 +244,9 @@ test2200 test2201 test2202 test2203 test2204 test2205 \ \ test2300 test2301 test2302 test2303 test2304 test2305 \ \ -test2400 test2401 test2402 \ +test2400 test2401 test2402 test2403 \ \ -test2500 test2501 test2502 \ +test2500 test2501 test2502 test2503 \ \ test2600 \ \ diff --git a/tests/data/test2403 b/tests/data/test2403 new file mode 100644 index 0000000000..11aa74b59b --- /dev/null +++ b/tests/data/test2403 @@ -0,0 +1,73 @@ + + + +HTTP +HTTP GET +HTTP/2 +HTTPS +-w +%header + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + +# +# Client-side + + +h2c +SSL +headers-api + + +http +http/2 + + +HTTP/2 GET + + + + +-k --http2 -w '%{header_json}\n' "https://%HOSTIP:%HTTP2TLSPORT/%TESTNUMBER" + + + + +# +# Verify data after the test has been "shot" + + +HTTP/2 200 +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +funny-head: yesyes +server: nghttpx +via: 1.1 nghttpx + +-foo- +{"date":["Tue, 09 Nov 2010 14:49:00 GMT"], +"content-length":["6"], +"content-type":["text/html"], +"funny-head":["yesyes"], +"server":["nghttpx"], +"via":["1.1 nghttpx"] +} + + + diff --git a/tests/data/test2503 b/tests/data/test2503 new file mode 100644 index 0000000000..550eb8a22e --- /dev/null +++ b/tests/data/test2503 @@ -0,0 +1,70 @@ + + + +HTTP +HTTP/3 +HTTPS +-w +%header + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + +# +# Client-side + + +http/3 +nghttpx-h3 +headers-api + + +http +http/3 + + +HTTP/3 header-api + + + + +-w '%{header_json}\n' --http3-only --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --resolve localhost:%HTTP3PORT:%HOSTIP https://localhost:%HTTP3PORT/%TESTNUMBER + + + + +# +# Verify data after the test has been "shot" + + +HTTP/3 200 +date: Tue, 09 Nov 2010 14:49:00 GMT +content-length: 6 +content-type: text/html +funny-head: yesyes +via: 1.1 nghttpx + +-foo- +{"date":["Tue, 09 Nov 2010 14:49:00 GMT"], +"content-length":["6"], +"content-type":["text/html"], +"funny-head":["yesyes"], +"via":["1.1 nghttpx"] +} + + +