path
path copied to clipboard
.. shouldn't traverse past a drive letter for file URLs
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.
Hey @nex3 Is the bug still relevant? Can you tell me more about it?
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://
.
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?
Again, I'm no longer the maintainer of this package, so I recommend asking @natebosch.
I think this is worth fixing, I don't yet have an understanding of the best fix.