From: Daniel Stenberg Date: Tue, 7 Mar 2023 23:32:37 +0000 (+0100) Subject: test421: -w %{header_json} test with multiple same header names X-Git-Tag: curl-8_0_0~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27a760087175275a81901c9b7edd7d5c73677832;p=thirdparty%2Fcurl.git test421: -w %{header_json} test with multiple same header names To reproduce the issue in #10704 --- diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index c4c6ddcadc..4a1dc2c1d7 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -68,7 +68,7 @@ test380 test381 test383 test384 test385 test386 test387 test388 test389 \ test390 test391 test392 test393 test394 test395 test396 test397 test398 \ test399 test400 test401 test402 test403 test404 test405 test406 test407 \ test408 test409 test410 test411 test412 test413 test414 test415 test416 \ -test417 test418 test419 test420 \ +test417 test418 test419 test420 test421 \ \ test430 test431 test432 test433 test434 test435 test436 \ \ diff --git a/tests/data/test421 b/tests/data/test421 new file mode 100644 index 0000000000..0e4130b064 --- /dev/null +++ b/tests/data/test421 @@ -0,0 +1,85 @@ + + + +header_json + + + +# +# Server-side + + +HTTP/1.1 200 OK +server: nginx +date: Tue, 07 Mar 2023 15:14:41 GMT +content-type: application/json +content-length: 6 +vary: Accept-Encoding +access-control-allow-origin: * +vary: Accept-Encoding +referrer-policy: strict-origin-when-cross-origin +access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS +access-control-max-age: 1728000 +access-control-allow-headers: Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS +access-control-expose-headers: +vary: Accept +etag: W/"2678f9ab2ba550d164e7cc014aefd31e" +cache-control: max-age=0, private, must-revalidate +x-request-id: 375b343b3d2ecf9b442c0daf00fc4a9a +strict-transport-security: max-age=31536000; includeSubDomains +x-content-type-options: nosniff +x-xss-protection: 1; mode=block +referrer-policy: strict-origin-when-cross-origin +feature-policy: accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none' + +-foo- + + + +# +# Client-side + + +http + + +HTTP GET multiple headers and %{header_json} + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{stderr}%{header_json}\n' -s + + + +# +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +{"server":["nginx"], +"date":["Tue, 07 Mar 2023 15:14:41 GMT"], +"content-type":["application/json"], +"content-length":["6"], +"vary":["Accept-Encoding","Accept-Encoding","Accept"], +"access-control-allow-origin":["*"], +"referrer-policy":["strict-origin-when-cross-origin","strict-origin-when-cross-origin"], +"access-control-allow-methods":["GET, POST, PUT, DELETE, OPTIONS"], +"access-control-max-age":["1728000"], +"access-control-allow-headers":["Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS"], +"access-control-expose-headers":["\r"], +"etag":["W/\"2678f9ab2ba550d164e7cc014aefd31e\""], +"cache-control":["max-age=0, private, must-revalidate"], +"x-request-id":["375b343b3d2ecf9b442c0daf00fc4a9a"], +"strict-transport-security":["max-age=31536000; includeSubDomains"], +"x-content-type-options":["nosniff"], +"x-xss-protection":["1; mode=block"], +"feature-policy":["accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'"] +} + + +