Skip to content

Commit

Permalink
Verify domain is not empty after Unicode ToASCII
Browse files Browse the repository at this point in the history
The empty host is not allowed in special non-"file" URLs, but Unicode ToASCII can result in the empty string, even if the input is not empty, for example:

* the input consists entirely of IDNA ignored code points
* the input is `xn--`.

Domain to ASCII (which invokes Unicode ToASCII) does not fail when it is called from the host parser with such an input, because VerifyDnsLength is false. So it needs an additional check.

Tests: web-platform-tests/wpt#23432.
  • Loading branch information
rmisev committed May 7, 2020
1 parent 8315a80 commit cceb435
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions url.bs
Expand Up @@ -397,6 +397,8 @@ decisions made, i.e. whether to use the <a>same site</a> or <a>schemelessly same

<li><p>If <var>result</var> is a failure value, <a>validation error</a>, return failure.

<li><p>If <var>result</var> is the empty string, <a>validation error</a>, return failure.

<li><p>Return <var>result</var>.
</ol>

Expand Down

0 comments on commit cceb435

Please sign in to comment.