test1644: HTTP -J, two redirects, use the last Location: name

This commit is contained in:
Daniel Stenberg 2026-01-25 23:44:12 +01:00
parent 81fe9bee04
commit fc19f8b10e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 72 additions and 1 deletions

View File

@ -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 \

71
tests/data/test1644 Normal file
View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
HTTP
HTTP GET
-J
</keywords>
</info>
<reply>
<data nocheck="yes">
HTTP/1.1 301 OK
Location: go/here/%TESTNUMBER0002#first
</data>
<data2 nocheck="yes">
HTTP/1.1 301 OK
Location: too/%TESTNUMBER0003#second
</data2>
<data3 nocheck="yes">
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
</data2>
</reply>
# Client-side
<client>
<server>
http
</server>
<name>
HTTP -J, two redirects, use the last Location: name
</name>
<command option="no-output,no-include">
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -L -O --output-dir %LOGDIR
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
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: */*
</protocol>
<file name="%LOGDIR/%TESTNUMBER0003">
12345
</file>
</verify>
</testcase>