curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: A canonical URL host name dilemma

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Sun, 10 Oct 2021 10:48:17 +0200 (CEST)

On Sat, 9 Oct 2021, Daniel Stenberg via curl-library wrote:

> The question is perhaps then if that new option should rather be A) "don't
> URL encode host names" or B) "don't URL encode host names that are valid IDN
> names".
>
> Making it A) is way simpler and make a more predictable behavior.

I realize I'm now down in the weeds and I probably lost all of your interest
by now but it struck me I should probably reverse the option:

Stick to returning the name *un*-encoded by default in URLs and introduce a
new option that percents-encode the host name when the URL is retrieved.

This, to maintain the existing behavior to a larger extent. Parsing a URL with
an IDN name and then again extracting the URL will then work identically as
before, with the addition that it will also decode percent-encoded parts of
the host name.

I'll work on this in the PR.

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-10-10