GNURLOPT_U...ICTED_AUTH(3)
π NAME π
First things first, bestie: you're on the GNURLOPT_U...ICTED_AUTH(3) page, from the curl_easy_setopt options manual β yes, the title is having a dramatic ellipsis moment, and we're obsessed. π
The option is CURLOPT_UNRESTRICTED_AUTH β it means send credentials to other hosts too. That's the whole vibe: it's the βokay, you can take my user+password with you when you bounce to another hostβ option. π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UNRESTRICTED_AUTH,
long goahead);
πΈ DESCRIPTION πΈ
Okay so here's the tea: set the long gohead parameter to 1L and libcurl will keep sending authentication (user+password) credentials when it follows locations β even when hostname changed. Yes, that's the whole point. It's giving βfollow me, and bring the login too.β π«Ά
(And yes, the page has gohead there and goahead in the synopsis β I'm not fixing the typo, I'm preserving the lore. π)
This option is meaningful only when you're setting CURLOPT_FOLLOWLOCATION(3) β like, that's the context where it actually does its thing. iykyk.
By default, libcurl will only send the given credentials to the initial host name as given in the original URL. Why? To avoid leaking username + password to other sites. No cap, that default is the cautious icon we need. π
π DEFAULT π
0
π¦ PROTOCOLS π¦
HTTP
β EXAMPLE β
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1L);
curl_easy_perform(curl);
}
π AVAILABILITY π
Along with HTTP. β¨
π RETURN VALUE π
Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that, bestie. π«Ά
π₯ SEE ALSO π₯
Cute sign-off: this page is from libcurl 7.37.0, dated 17 Jun 2014, and it's the GNURLOPT_U...ICTED_AUTH(3) page. Byeee, bestie π
β¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms