lib: add CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY

With this change, the argument passed to the CURLOPT_FOLLOWLOCATION
option is now instead a "mode" instead of just a boolean. Documentation
is extended to describe the two new modes.

Test 1571 to 1581 verify.

Closes #16473
This commit is contained in:
Daniel Stenberg 2025-03-03 11:35:48 +01:00
parent 294136b754
commit fb13923dd6
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
23 changed files with 1328 additions and 34 deletions

View file

@ -525,7 +525,9 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
/*
* Follow Location: header hints on an HTTP-server.
*/
data->set.http_follow_location = enabled;
if(uarg > 3)
return CURLE_BAD_FUNCTION_ARGUMENT;
data->set.http_follow_mode = (unsigned char)uarg;
break;
case CURLOPT_UNRESTRICTED_AUTH: