- From: Alwin Blok <notifications@github.com>
- Date: Sun, 31 Jan 2021 22:40:54 -0800
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/url/issues/574/770611733@github.com>
Yes, this is unpleasant. I remember two testcases in WPT that are related. (see below). These are 'congruence bugs', in the mathematical sense. They are not exactly reparsing bugs according to the spec, but they are very similar. You'd want to prevent components that 'look like drive letters' from 'becoming drive letters' when normalizing. This is similar to what was done in #505 for hosts (there, path components would 'turn into a host'). You can resolve this by percent encoding (part of) the first component upon serialization, if it would otherwise turn into a drive letter. Or otherwise, prefix `./` as in #505. For implementations and the spec, It's useful to store the drive as a property on the (internal) URL record to avoid branching on the content of the first path component. Related tests: ``` { "input": "file:///./Y:", "base": "about:blank", "href": "file:///Y:", "protocol": "file:", "username": "", "password": "", "host": "", "hostname": "", "port": "", "pathname": "/Y:", "search": "", "hash": "" } ``` ``` { "input": "file:///./y:", "base": "about:blank", "href": "file:///y:", "protocol": "file:", "username": "", "password": "", "host": "", "hostname": "", "port": "", "pathname": "/y:", "search": "", "hash": "" } ``` -- 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/issues/574#issuecomment-770611733
Received on Monday, 1 February 2021 06:41:09 UTC