1CURLOPT_UNRESTRICTED_AUTH(3)curl_easy_setopt optionsCURLOPT_UNRESTRICTED_AUTH(3)
2
3
4
6 CURLOPT_UNRESTRICTED_AUTH - send credentials to other hosts too
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UNRESTRICTED_AUTH,
12 long goahead);
13
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
25 0
26
28 HTTP
29
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
40 Along with HTTP
41
43 Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
44
46 CURLOPT_FOLLOWLOCATION(3), CURLOPT_USERPWD(3),
47
48
49
50libcurl 7.69.1 May 15, 2017 CURLOPT_UNRESTRICTED_AUTH(3)