Skip to content

Commit c3d173f

Browse files
committedNov 29, 2024·
Editorial: check forbidden domain code points in domain to ASCII
Fixes #818.
1 parent a6e4492 commit c3d173f

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed
 

‎url.bs

+22-14
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,6 @@ valid input. User agents, especially conformance checkers, are encouraged to rep
116116
<p class=note>If details about <a abstract-op lt=ToASCII>Unicode ToASCII</a> errors are
117117
recorded, user agents are encouraged to pass those along.
118118
<td class=yes>Yes
119-
<tr>
120-
<td><dfn>domain-to-Unicode</dfn>
121-
<td>
122-
<p><a abstract-op lt=ToUnicode>Unicode ToUnicode</a> records an error. [[UTS46]]
123-
<p class=note>The same considerations as with <a>domain-to-ASCII</a> apply.
124-
<td class=no>·
125-
<tbody>
126-
<tr>
127-
<th colspan=3 scope=rowgroup><a href=#host-parsing>Host parsing</a>
128-
<!-- host parser -->
129119
<tr>
130120
<td><dfn>domain-invalid-code-point</dfn>
131121
<td>
@@ -137,6 +127,15 @@ valid input. User agents, especially conformance checkers, are encouraged to rep
137127
<p>"<code>https://exa%23mple.org</code>"
138128
</div>
139129
<td class=yes>Yes
130+
<tr>
131+
<td><dfn>domain-to-Unicode</dfn>
132+
<td>
133+
<p><a abstract-op lt=ToUnicode>Unicode ToUnicode</a> records an error. [[UTS46]]
134+
<p class=note>The same considerations as with <a>domain-to-ASCII</a> apply.
135+
<td class=no>·
136+
<tbody>
137+
<tr>
138+
<th colspan=3 scope=rowgroup><a href=#host-parsing>Host parsing</a>
140139
<!-- opaque-host parser -->
141140
<tr>
142141
<td><dfn>host-invalid-code-point</dfn>
@@ -899,7 +898,7 @@ concepts.
899898
<h3 id=idna>IDNA</h3>
900899

901900
<div algorithm>
902-
<p>The <dfn id=concept-domain-to-ascii>domain to ASCII</dfn> algorithm, given a <a>string</a>
901+
<p>The <dfn id=concept-domain-to-ascii>domain to ASCII</dfn> algorithm, given a <a for=/>string</a>
903902
<var>domain</var> and a boolean <var>beStrict</var>, runs these steps:
904903

905904
<ol>
@@ -921,6 +920,18 @@ concepts.
921920
<li><p>If <var>result</var> is the empty string, <a>domain-to-ASCII</a> <a>validation error</a>,
922921
return failure.
923922

923+
<li>
924+
<p>If <var>beStrict</var> is false and <var>result</var> contains a
925+
<a>forbidden domain code point</a>, <a>domain-invalid-code-point</a> <a>validation error</a>,
926+
return failure.
927+
928+
<p class=note>Due to web compatibility and compatibility with non-DNS-based systems the
929+
<a>forbidden domain code points</a> are a subset of those disallowed when <i>UseSTD3ASCIIRules</i>
930+
is true. See also <a href="https://github.com/whatwg/url/issues/397">issue #397</a>.
931+
932+
<li><p><a for=/>Assert</a>: <var>result</var> does not contain a
933+
<a>forbidden domain code point</a>.
934+
924935
<li><p>Return <var>result</var>.
925936
</ol>
926937

@@ -1027,9 +1038,6 @@ false), and then runs these steps. They return failure or a <a for=/>host</a>.
10271038

10281039
<li><p>If <var>asciiDomain</var> is failure, then return failure.
10291040

1030-
<li><p>If <var>asciiDomain</var> contains a <a>forbidden domain code point</a>,
1031-
<a>domain-invalid-code-point</a> <a>validation error</a>, return failure.
1032-
10331041
<li><p>If <var>asciiDomain</var> <a lt="ends in a number checker">ends in a number</a>, then return
10341042
the result of <a lt="IPv4 parser">IPv4 parsing</a> <var>asciiDomain</var>.
10351043

0 commit comments

Comments
 (0)
Please sign in to comment.