diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-01-10 15:35:48 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-01-11 00:21:28 +0100 |
commit | 229930762fbbeec14ec6544d180f12958c86f330 (patch) | |
tree | 76ada02e89eb00ebb20cc191408b3a0917f82077 | |
parent | 16b27e06bd5589ff4acf80a55de976dbe56575c0 (diff) | |
download | curl-229930762fbbeec14ec6544d180f12958c86f330.tar.gz |
url: if IDNA conversion fails, fallback to Transitional
This improves IDNA2003 compatiblity.
Reported-by: Bubu on github
Fixes #6423
Closes #6428
-rw-r--r-- | lib/url.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1541,6 +1541,11 @@ CURLcode Curl_idnconvert_hostname(struct connectdata *conn, int flags = IDN2_NFC_INPUT; #endif int rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, flags); + if(rc != IDN2_OK) + /* fallback to TR46 Transitional mode for better IDNA2003 + compatibility */ + rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, + IDN2_TRANSITIONAL); if(rc == IDN2_OK) { host->encalloc = (char *)ace_hostname; /* change the name pointer to point to the encoded hostname */ |