]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test1646: netrc parsing without user match but user in URL
authorDaniel Stenberg <daniel@haxx.se>
Fri, 15 May 2026 22:54:13 +0000 (00:54 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 May 2026 13:19:22 +0000 (15:19 +0200)
Follow-up to 4ae1d7cc2643e

tests/data/Makefile.am
tests/data/test1646 [new file with mode: 0644]

index 9c63d7674e7b1b6cc428bea3357168b1fef892ad..b330af3b90f9e502a7260b35627d46ec4e7c01ac 100644 (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 \
diff --git a/tests/data/test1646 b/tests/data/test1646
new file mode 100644 (file)
index 0000000..3df03be
--- /dev/null
@@ -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>