Text of github.com › curl › curl › issues › 14656 as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

curl_url_set fails for encoded hostname · Issue #14656 · curl/curl · GitHub

Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert curl_url_set fails for encoded hostname #14656 New issue Copy link New issue Copy link Closed Closed curl_url_set fails for encoded hostname #14656 Copy link Assignees Labels URL libcurl API regression Description muttalkadavul opened on Aug 23, 2024 Issue body actions I did this int main () { std :: string input = "resum%33%35.com" ; CURLUcode rc = CURLUE_BAD_HANDLE ; CURLU * urlh = curl_url (); rc = curl_url_set ( urlh , CURLUPART_HOST , input . c_str (), 0 ); if ( rc != CURLUE_OK ) { std :: cout << "curlucode = " << rc << std :: endl ; curl_url_cleanup ( urlh ); } std :: cout << "Hostname: " << input << std :: endl ; std :: cout << "libcurl version" << curl_version () << std :: endl ; return 0 ; } I expected the following I expected it to return CURLUE_OK but got this curlucode = 21 Hostname: resum%33%35.com libcurl versionlibcurl/8.9.1 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libpsl/0.21.0 When I run the above code with an older curl I get Hostname: resum%33%35.com libcurl versionlibcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3 No error! curl/libcurl version libcurl versionlibcurl/8.9.1 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libpsl/0.21.0 operating system Ubuntu 22.04 Activity bagder self-assigned this on Aug 23, 2024 bagder added URL libcurl API on Aug 23, 2024 bagder commented on Aug 23, 2024 bagder on Aug 23, 2024 Member More actions Confirmed.

The problem is that the hostname check function is called with the URL encoded host name as input and not the decoded version so it thinks the % in there is invalid. Regression from 0a0c9b6 PR coming up. Reacted by Venkat Krishna R muttalkadavul commented on Aug 23, 2024 muttalkadavul on Aug 23, 2024 Author More actions That was quick! Thanks! bagder added regression on Aug 23, 2024 bagder added a commit that references this issue on Aug 23, 2024 urlapi: verify URL *decoded* hostname when set This issue will close once commit a28ae82 is merged into the 'master' branch. a28ae82 bagder closed this as completed in d1394a0 on Aug 23, 2024 vszakats added a commit that references this issue on Aug 23, 2024 urlapi: verify URL *decoded* hostname when set This issue will close once commit d1394a0 is merged into the 'master' branch. d1394a0 Sign up for free to join this conversation on GitHub.

Already have an account? Sign in to comment Metadata Metadata Assignees bagder Labels URL libcurl API regression Type No type Projects No projects Milestone No milestone Relationships None yet Development No branches or pull requests Issue actions You can’t perform that action at this time.