/
githubmirror
/
curl
Обзор
Документация
Войти
/
githubmirror
/
curl
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/data/test3224
69 строк
2 KB
Memduh Çelik
tests: pin connection reuse rules for partial, host, and credentials
30 июн 2026, 10:57
Не верифицирован
30 июн 2026, 10:57
ddc76c2
Код
Авторство
О чём код?
<?xml version="1.0" encoding="US-ASCII"?> <testcase> # HTTP has PROTOPT_CREDSPERREQUEST: Basic credentials are attached to the # request, not to the connection for reuse matching. Different -u values # therefore still reuse the idle connection (see also test1134). Protocols # without CREDSPERREQUEST (and NTLM/Negotiate mid-handshake) refuse reuse. # This test pins the HTTP Basic behavior with an explicit num_connects check. <info> <keywords> HTTP HTTP GET HTTP Basic auth connection reuse --next </keywords> </info> <reply> <data nocheck="yes"> HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 3 Content-Type: text/plain A1 </data> <data1 nocheck="yes"> HTTP/1.1 200 OK Date: Tue, 09 Nov 2010 14:49:00 GMT Content-Length: 3 Content-Type: text/plain B2 </data1> <servercmd> connection-monitor </servercmd> </reply> <client> <server> http </server> <name> HTTP connection reused across different Basic auth credentials </name> <command> http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u user1:password1 -o %LOGDIR/3224-1 -w "connects=%{num_connects}/" --next http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -u user2:password2 -o %LOGDIR/3224-2 -w "connects=%{num_connects}/" </command> </client> <verify> <protocol crlf="headers"> GET /%TESTNUMBER HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user1:password1]b64% User-Agent: curl/%VERSION Accept: */* GET /%TESTNUMBER0001 HTTP/1.1 Host: %HOSTIP:%HTTPPORT Authorization: Basic %b64[user2:password2]b64% User-Agent: curl/%VERSION Accept: */* [DISCONNECT] </protocol> <stdout nonewline="yes"> connects=1/connects=0/ </stdout> </verify> </testcase>