transfer: clear the old autoreferer

Verify in test 2505

Closes #21322
This commit is contained in:
Daniel Stenberg 2026-04-15 08:11:33 +02:00
parent c60d90cd65
commit fa057ea3de
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 145 additions and 3 deletions

View file

@ -265,7 +265,7 @@ test2309 \
\
test2400 test2401 test2402 test2403 test2404 test2405 test2406 test2407 \
\
test2500 test2501 test2502 test2503 test2504 \
test2500 test2501 test2502 test2503 test2504 test2505 \
\
test2600 test2601 test2602 test2603 test2604 test2605 \
\

67
tests/data/test2505 Normal file
View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
HTTP
referer
autoreferer
</keywords>
</info>
# Server-side
<reply>
<data crlf="headers" nocheck="yes">
HTTP/1.1 301 redirect
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: server.example.com
Content-Length: 47
Location: %TESTNUMBER0002
file contents should appear once for each file
</data>
<data2 crlf="headers" nocheck="yes">
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: server.example.com
Content-Length: 47
file contents should appear once for each file
</data2>
</reply>
# Client-side
<client>
<server>
http
</server>
<tool>
lib%TESTNUMBER
</tool>
<name>
verify CURLOPT_AUTOREFERER switched off
</name>
<command>
http://%HOSTIP:%HTTPPORT
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
GET / HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
GET /%TESTNUMBER0002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
Referer: http://%HOSTIP:%HTTPPORT/
GET / HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
</protocol>
</verify>
</testcase>