Skip to content

Commit a19495e

Browse files
authored
Fix file URL reparse issue
By ensuring that a file URL's host is never null. Tests: web-platform-tests/wpt#25989. Fixes #549.
1 parent 47efa00 commit a19495e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

url.bs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ It is initially the empty string.
12601260
<td>
12611261
<td>
12621262
<td>
1263-
<td>
1263+
<td>
12641264
<tr>
12651265
<td>Others
12661266
<td>
@@ -1762,7 +1762,7 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
17621762
and <var>buffer</var> is "<code>file</code>", then return.
17631763

17641764
<li><p>If <var>url</var>'s <a for=url>scheme</a> is "<code>file</code>" and its
1765-
<a for=url>host</a> is an <a>empty host</a> or null, then return.
1765+
<a for=url>host</a> is an <a>empty host</a>, then return.
17661766
</ol>
17671767

17681768
<li><p>Set <var>url</var>'s <a for=url>scheme</a> to <var>buffer</var>.
@@ -2139,6 +2139,8 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
21392139
<ol>
21402140
<li><p>Set <var>url</var>'s <a for=url>scheme</a> to "<code>file</code>".
21412141

2142+
<li><p>Set <var>url</var>'s <a for=url>host</a> to the empty string.
2143+
21422144
<li>
21432145
<p>If <a>c</a> is U+002F (/) or U+005C (\), then:
21442146

@@ -2525,10 +2527,6 @@ then runs these steps, returning an <a>ASCII string</a>:
25252527
<var>output</var>.
25262528
</ol>
25272529

2528-
<li><p>Otherwise, if <var>url</var>'s <a for=url>host</a> is null and
2529-
<var>url</var>'s <a for=url>scheme</a> is "<code>file</code>", append
2530-
"<code>//</code>" to <var>output</var>.
2531-
25322530
<li><p>If <var>url</var>'s <a for=url>cannot-be-a-base-URL flag</a> is set, append <var>url</var>'s
25332531
<a for=url>path</a>[0] to <var>output</var>.
25342532

0 commit comments

Comments
 (0)