]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_url_set: elaborate on scheme guessing
authorDaniel Stenberg <daniel@haxx.se>
Mon, 1 Jul 2024 09:03:08 +0000 (11:03 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 1 Jul 2024 14:45:58 +0000 (16:45 +0200)
Explain a little more and refer to the CURLU_NO_GUESS_SCHEME flag
for getting scheme or URL.

Closes #14071

docs/libcurl/curl_url_set.md

index e0fbd7d275512573528c24998fa9347552c0eb26..cb2d8c877d4e89d317e0f5ccf0b9da11e87a2cf5 100644 (file)
@@ -189,8 +189,8 @@ manner.
 ## CURLU_DEFAULT_SCHEME
 
 If set, allows the URL to be set without a scheme and then sets that to the
-default scheme: HTTPS. Overrides the *CURLU_GUESS_SCHEME* option if both
-are set.
+default scheme: HTTPS. Overrides the *CURLU_GUESS_SCHEME* option if both are
+set.
 
 ## CURLU_GUESS_SCHEME
 
@@ -200,6 +200,14 @@ subdomain name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that scheme is
 used, otherwise it picks HTTP. Conflicts with the *CURLU_DEFAULT_SCHEME*
 option which takes precedence if both are set.
 
+If guessing is not allowed and there is no default scheme set, trying to parse
+a URL without a scheme returns error.
+
+If the scheme ends up set as a result of guessing, i.e. it is not actually
+present in the parsed URL, it can later be figured out by using the
+**CURLU_NO_GUESS_SCHEME** flag when subsequently getting the URL or the scheme
+with curl_url_get(3).
+
 ## CURLU_NO_AUTHORITY
 
 If set, skips authority checks. The RFC allows individual schemes to omit the