From fc19f8b10e8269996119286d60c1f8ca27c97ec5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 25 Jan 2026 23:44:12 +0100 Subject: [PATCH] test1644: HTTP -J, two redirects, use the last Location: name --- tests/data/Makefile.am | 2 +- tests/data/test1644 | 71 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tests/data/test1644 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index d7115003bf..800f59cd7a 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -218,7 +218,7 @@ test1620 test1621 test1622 test1623 \ \ test1630 test1631 test1632 test1633 test1634 test1635 test1636 \ \ -test1640 test1641 test1642 test1643 \ +test1640 test1641 test1642 test1643 test1644 \ \ test1650 test1651 test1652 test1653 test1654 test1655 test1656 test1657 \ test1658 \ diff --git a/tests/data/test1644 b/tests/data/test1644 new file mode 100644 index 0000000000..29d4963047 --- /dev/null +++ b/tests/data/test1644 @@ -0,0 +1,71 @@ + + + + +HTTP +HTTP GET +-J + + + + + +HTTP/1.1 301 OK +Location: go/here/%TESTNUMBER0002#first + + + +HTTP/1.1 301 OK +Location: too/%TESTNUMBER0003#second + + + +HTTP/1.1 200 OK +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 6 +Connection: close +Content-Type: text/html + +12345 + + + +# Client-side + + +http + + +HTTP -J, two redirects, use the last Location: name + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -L -O --output-dir %LOGDIR + + + +# Verify data after the test has been "shot" + + +GET /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /go/here/%TESTNUMBER0002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + +GET /go/here/too/%TESTNUMBER0003 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +12345 + + + +