[whatwg/url] [Editorial] Guarantee that strings encoded with the component encode-set are valid opaque host strings. (#584)

Users require guidance about how to encode data as an opaque host string - for instance, it is common to want to encode a filesystem path as a hostname to create an `http+unix:` URL.

Moreover, the `host`/`hostname` setter is unique in that it will fail if the new value contains forbidden host code units, unlike other setters which automatically percent-encode any invalid characters, so it is important that users correctly encode the new value in order for the operation to succeed.

I would like to advise users to encode their hostnames with the component encode-set, and it would be nice if there was an explicit mention in the standard to back this advice up - as there is for the path, query and fragment.


<!--
    This comment and the below content is programatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/url/584.html" title="Last updated on Feb 24, 2021, 5:30 PM UTC (423c36e)">Preview</a> | <a href="https://whatpr.org/url/584/557567c...423c36e.html" title="Last updated on Feb 24, 2021, 5:30 PM UTC (423c36e)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/url/pull/584

-- Commit Summary --

  * Guarantee that strings encoded with the component encode-set are valid opaque host strings.

-- File Changes --

    M url.bs (3)

-- Patch Links --

https://github.com/whatwg/url/pull/584.patch
https://github.com/whatwg/url/pull/584.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/584

Received on Wednesday, 24 February 2021 17:30:27 UTC