test1646: netrc parsing without user match but user in URL

Follow-up to 4ae1d7cc26
This commit is contained in:
Daniel Stenberg 2026-05-16 00:54:13 +02:00
parent 4ae1d7cc26
commit 7ca5f939c8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 46 additions and 0 deletions

View file

@ -218,6 +218,7 @@ test1628 test1629 \
\
test1630 test1631 test1632 test1633 test1634 test1635 test1636 test1637 \
test1638 test1639 test1640 test1641 test1642 test1643 test1644 test1645 \
test1646 \
\
test1650 test1651 test1652 test1653 test1654 test1655 test1656 test1657 \
test1658 test1659 test1660 test1661 test1662 test1663 test1664 test1665 \

45
tests/data/test1646 Normal file
View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
netrc
</keywords>
</info>
<reply>
<data>
HTTP/1.1 200 OK
Content-Length: 6
12345
</data>
</reply>
# Client-side
<client>
<server>
http
</server>
<name>
netrc parsing without user match but user in URL
</name>
<command>
--netrc --netrc-file %LOGDIR/netrc%TESTNUMBER http://alice@example.com:%HTTPPORT/%TESTNUMBER --resolve example.com:%HTTPPORT:%HOSTIP
</command>
<file name="%LOGDIR/netrc%TESTNUMBER" >
machine example.com login bob password sekret
</file>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
GET /%TESTNUMBER HTTP/1.1
Host: example.com:%HTTPPORT
Authorization: Basic %b64[alice:]b64%
User-Agent: curl/%VERSION
Accept: */*
</protocol>
</verify>
</testcase>