Skip to content

Commit

Permalink
Change validation error when a URL has credentials but no host
Browse files Browse the repository at this point in the history
  • Loading branch information
karwa committed Sep 26, 2023
1 parent 45a483a commit 3e8cd02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions url.bs
Expand Up @@ -309,16 +309,17 @@ const url = new URL("馃挬", "mailto:user@example.org");</code></pre>
<p>The input <a>includes credentials</a>.
<div class=example id=example-invalid-credentials>
<p>"<code>https://user@example.org</code>"
<p>"<code>https://user:pass@</code>"
<p>"<code>ssh://user@example.org</code>"
</div>
<td class=yes>Yes<br>(only if there is no host)
<td class=no>
<tr>
<td><dfn>host-missing</dfn>
<td>
<p>The input has a <a>special scheme</a>, but does not contain a <a for=/>host</a>.
<div class=example id=example-host-missing>
<p>"<code>https://#fragment</code>"
<p>"<code>https://:443</code>"
<p>"<code>https://user:pass@</code>"
</div>
<td class=yes>Yes
<tr>
Expand Down Expand Up @@ -2448,7 +2449,7 @@ and then runs these steps:

<ol>
<li><p>If <var>atSignSeen</var> is true and <var>buffer</var> is the empty string,
<a>invalid-credentials</a> <a>validation error</a>, return failure.
<a>host-missing</a> <a>validation error</a>, return failure.
<!-- No URLs with userinfo, but without host. For special URLs it would also not be
idempotent:
https://@/example.org/ -> https:///example.org/ -> https://example.org/ -->
Expand Down

0 comments on commit 3e8cd02

Please sign in to comment.