Re: [whatwg/url] URL: trim leading slashes of file URL paths (#278)

annevk commented on this pull request.



> @@ -2113,6 +2121,12 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
 
        <li><p>Set <var>buffer</var> to the empty string.
 
+       <li><p>If <var>url</var>'s <a for=url>scheme</a> is "<code>file</code>" and <a>c</a> is
+       <a>EOF code point</a>, "<code>?</code>", or "<code>#</code>", then while <var>url</var>'s
+       <a for=url>path</a>'s <a for=list>size</a> is not 1 and <var>url</var>'s
+       <a for=url>path</a>[0] is the empty string, <a>validation error</a>, <a for=list>remove</a>

So with `file://` I think path will still be non-empty due to 1.4.2. We don't have any testcase that triggers path's size being 0. Maybe we don't test `file://` explicitly though.

(That's the reason I wanted to add the assert first. I want to make sure it would actually be triggered. I agree that greater than is what we want here.)

-- 
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/278#discussion_r107476966

Received on Wednesday, 22 March 2017 17:20:51 UTC