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

@ -175,6 +175,16 @@ typedef enum {
#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
#define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
/* bits for the CURLOPT_FOLLOWLOCATION option */
#define CURLFOLLOW_ALL 1L /* generic follow redirects */
/* Do not use the custom method in the follow-up request if the HTTP code
instructs so (301, 302, 303). */
#define CURLFOLLOW_OBEYCODE 2L
/* Only use the custom method in the first request, always reset in the next */
#define CURLFOLLOW_FIRSTONLY 3L
struct curl_httppost {
struct curl_httppost *next; /* next entry in the list */
char *name; /* pointer to allocated name */