dart-lang / core

This repository is home to core Dart packages.
https://pub.dev/publishers/dart.dev
BSD 3-Clause "New" or "Revised" License
11 stars 2 forks source link

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

Open nex3 opened 7 years ago

nex3 commented 7 years ago

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.

jddeep commented 4 years ago

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

nex3 commented 4 years ago

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://.

jddeep commented 4 years ago

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?

nex3 commented 4 years ago

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

natebosch commented 4 years ago

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