curl-curl/tests/data/test755
Daniel Stenberg 378713deb2
netrc: use the NETRC environment variable (first) if set
Add test 755 to verify.

Proposed-by: Berthin Torres Callañaupa
URL: https://curl.se/mail/lib-2025-06/0015.html

Closes #17712
2025-07-27 18:26:43 +02:00

60 lines
913 B
Plaintext

<testcase>
<info>
<keywords>
HTTP
netrc
</keywords>
</info>
#
# Server-side
<reply>
<data>
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
Content-Length: 9
contents
</data>
</reply>
#
# Client-side
<client>
<server>
http
</server>
<name>
netrc with NETRC pointing out the file
</name>
<file name="%LOGDIR/netrc%TESTNUMBER">
machine foo.host login foo password alone-in-the-dark
</file>
<setenv>
NETRC=%LOGDIR/netrc%TESTNUMBER
</setenv>
<command>
http://foo.host/%TESTNUMBER --proxy %HOSTIP:%HTTPPORT -A "" --netrc
</command>
<features>
proxy
</features>
</client>
#
# Verify data after the test has been "shot"
<verify>
<protocol crlf="yes">
GET http://foo.host/%TESTNUMBER HTTP/1.1
Host: foo.host
Authorization: Basic %b64[foo:alone-in-the-dark]b64%
Accept: */*
Proxy-Connection: Keep-Alive
</protocol>
</verify>
</testcase>