]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test421: -w %{header_json} test with multiple same header names
authorDaniel Stenberg <daniel@haxx.se>
Tue, 7 Mar 2023 23:32:37 +0000 (00:32 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 8 Mar 2023 23:13:41 +0000 (00:13 +0100)
To reproduce the issue in #10704

tests/data/Makefile.inc
tests/data/test421 [new file with mode: 0644]

index c4c6ddcadce4e999a33053a76ba866e1c9b866ac..4a1dc2c1d79ea580ffab040c7d8c7835c78f7fbb 100644 (file)
@@ -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 (file)
index 0000000..0e4130b
--- /dev/null
@@ -0,0 +1,85 @@
+<testcase>
+<info>
+<keywords>
+header_json
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data crlf="yes">
+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-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+HTTP GET multiple headers and %{header_json}
+</name>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{stderr}%{header_json}\n' -s
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol crlf="yes">
+GET /%TESTNUMBER HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+<stderr mode="text">
+{"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'"]
+}
+</stderr>
+</verify>
+</testcase>