test1543: verify CURLINFO_EFFECTIVE_URL with CURLOPT_CURLU set

Triggered by a bug report from Adam Light:
https://curl.se/mail/lib-2022-06/0013.html - which ended up being mostly
a misunderstanding of how CURLINFO_EFFECTIVE_URL works.

Closes #8971
This commit is contained in:
Daniel Stenberg 2022-06-08 16:32:46 +02:00
parent 90a7017acb
commit 5121d98c22
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 116 additions and 7 deletions

View file

@ -193,7 +193,7 @@ test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \
test1516 test1517 test1518 test1519 test1520 test1521 test1522 test1523 \
test1524 test1525 test1526 test1527 test1528 test1529 test1530 test1531 \
test1532 test1533 test1534 test1535 test1536 test1537 test1538 test1539 \
test1540 test1542 \
test1540 test1542 test1543 \
\
test1550 test1551 test1552 test1553 test1554 test1555 test1556 test1557 \
test1558 test1559 test1560 test1561 test1562 test1563 test1564 test1565 \

76
tests/data/test1543 Normal file
View file

@ -0,0 +1,76 @@
<testcase>
<info>
<keywords>
HTTP
CURLOPT_CURLU
</keywords>
</info>
#
# Similar to 1518 but using CURLOPT_CURLU
#
# Server-side
<reply>
<data2 nocheck="yes">
HTTP/1.1 200 OK
Date: Thu, 17 Mar 2016 14:41:00 GMT
Server: test-server/fake
X-Special: swsclose
Content-Length: 0
Connection: close
</data2>
<data nocheck="yes">
HTTP/1.1 302 redirect
Date: Thu, 17 Mar 2016 14:41:00 GMT
Server: test-server/fake
Content-Type: text/plain; charset=US-ASCII
Location: ../%TESTNUMBER0002
Content-Length: 0
Connection: close
</data>
</reply>
# Client-side
<client>
<server>
http
</server>
# tool is what to use instead of 'curl'
<tool>
lib%TESTNUMBER
</tool>
<name>
CURLOPT_CURLU, URL with space and CURLINFO_EFFECTIVE_URL
</name>
<command>
"http://%HOSTIP:%HTTPPORT/ /with/ space/ /file"
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<protocol>
GET /%20/with/%20space/%20/file HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
GET /%20/with/%20space/%TESTNUMBER0002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
</protocol>
<stdout>
res 0
status 200
redirects 1
effectiveurl http://%HOSTIP:%HTTPPORT/%20/with/%20space/%TESTNUMBER0002
redirecturl blank
</stdout>
<errorcode>
0
</errorcode>
</verify>
</testcase>