1CURLOPT_UNRESTRICTED_AUTH(3)curl_easy_setopt optionsCURLOPT_UNRESTRICTED_AUTH(3)
2
3
4

NAME

6       CURLOPT_UNRESTRICTED_AUTH - send credentials to other hosts too
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UNRESTRICTED_AUTH,
12                                 long goahead);
13

DESCRIPTION

15       Set  the  long  gohead parameter to 1L to make libcurl continue to send
16       authentication (user+password) credentials  when  following  locations,
17       even when hostname changed. This option is meaningful only when setting
18       CURLOPT_FOLLOWLOCATION(3).
19
20       By default, libcurl will only send given  credentials  to  the  initial
21       host  name  as  given  in the original URL, to avoid leaking username +
22       password to other sites.
23

DEFAULT

25       0
26

PROTOCOLS

28       HTTP
29

EXAMPLE

31       CURL *curl = curl_easy_init();
32       if(curl) {
33         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
34         curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
35         curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1L);
36         curl_easy_perform(curl);
37       }
38

AVAILABILITY

40       Along with HTTP
41

RETURN VALUE

43       Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
44

SEE ALSO

46       CURLOPT_FOLLOWLOCATION(3), CURLOPT_USERPWD(3),
47
48
49
50libcurl 7.71.1                   May 15, 2017     CURLOPT_UNRESTRICTED_AUTH(3)
Impressum