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

@ -1958,7 +1958,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
* String to set in the HTTP Referer: field.
*/
result = Curl_setstropt(&s->str[STRING_SET_REFERER], ptr);
Curl_bufref_set(&data->state.referer, s->str[STRING_SET_REFERER], 0, NULL);
break;
case CURLOPT_USERAGENT: