path icon indicating copy to clipboard operation
path copied to clipboard

.. shouldn't traverse past a drive letter for file URLs

Open nex3 opened this issue 8 years ago • 5 comments

According to the WHATWG URL spec, .. shouldn't traverse past a drive letter if it's the only component in a file URL's path.

nex3 avatar Dec 02 '16 00:12 nex3

Hey @nex3 Is the bug still relevant? Can you tell me more about it?

jddeep avatar Feb 22 '20 05:02 jddeep

Yes, it's still relevant. For example:

import 'package:path/path.dart' as p;

main() {
  print(p.url.normalize('file:///C:/..'));
}

This should print file:///C:, but it currently prints file://.

nex3 avatar Feb 24 '20 18:02 nex3

I see well we can solve this with some string manipulation and checks for these drive letters and return the path accordingly from the normalize function of the context.dart file. What do you say?

jddeep avatar Feb 25 '20 04:02 jddeep

Again, I'm no longer the maintainer of this package, so I recommend asking @natebosch.

nex3 avatar Feb 25 '20 22:02 nex3

I think this is worth fixing, I don't yet have an understanding of the best fix.

natebosch avatar Feb 25 '20 22:02 natebosch