Re: [whatwg/url] Needs to ignore repeated slashes in file URL (#232)

I did read through it, it seems to have gone from wanting to ignore slashes after `file:///` via a reparsing issue to this solution. 

I want to make a case for keeping path normalization of file URLs and other 'special' URLs the same. 
They have been the same (barring drive letters) until this change was made. 

However, none of the browsers (or Edge?) implement the specced behaviour.
I tested Chrome canary, Safari preview and Firefox nightly. 

| Input | Firefox and Safari | Chrome |
| ----- | ------------------ | ------ |
| `/..//localhost//pig` against `file://lion/` |  `file:////localhost//pig` | `file://lion//localhost//pig` (seems right) |
| `file://localhost//a//../..//` | `file://///` | `file://localhost///` |
| `file://localhost////foo` |`file://////foo` | `file://localhost////foo` |
| `file:////foo` | `file:////foo` | `file:///foo` |

- All agree on the pathName except in the fourth case. (I don't know why Safari and Firefox drop the host in the first.) 
- Only Chrome (Edge?) match the spec in only the fourth case. 
- Firefox and Safari do not ignore slashes and thereby avoid the reparsing issue. 
- Chrome (Edge?) only ignores slashes immediately following `file:///` and avoids the reparsing issue by keeping `localhost`. 

Some ideas for alternatives:
1. Always replace the empty host with `localhost`.
2. Do so only in ambiguous cases.
3. Prefix ambiguous pathNames with `./`.
4. Don't collapse slashes at all.
5. Come up with something else?

I guess 1, 4 (and 5) seem to be the more reasonable ones. 

Thanks,

-- 
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/232#issuecomment-406795516

Received on Saturday, 21 July 2018 13:05:34 UTC