Re: [url] URL.pathname getter for file URLs produces odd result on Windows (#103)

IE11: "C:/Folder/File4.txt"
Edge: "/C:/Folder/File4.txt"
Chrome 49: "/C:/Folder/File4.txt"
FF 44: "/C:/Folder/File4.txt"
Safari 9:.0.3: "/C:/Folder/File4.txt"

Thinking about it a bit more I'm not convinced parser.pathname is always a valid OS pathname on Mac/*nix either when special filename characters (e.g. $ or *) or unicode sequences are present in the URL. 

There are use cases where paths represented as file URLs need turned into local OS paths (e.g. for FileAPI and server-side JS). 

Does the URL interface need another property/method to handle this? .NET has URI.LocalPath for this purpose; Cocoa has NSURL.path which can be passed to other Cocoa file APIs. 

Seems like there should be an API for this somewhere (even if it's not in the URL interface) since there's a long history of security issues caused by path parsing vulnerabilities.

---
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/103#issuecomment-199802213

Received on Tuesday, 22 March 2016 13:02:17 UTC