Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nex3 opened this issue Dec 2, 2016 · 5 comments
Open

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

nex3 opened this issue Dec 2, 2016 · 5 comments
Labels
package:path type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@nex3
Copy link
Member

nex3 commented Dec 2, 2016

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 nex3 added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Dec 2, 2016
@jddeep
Copy link

jddeep commented Feb 22, 2020

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

@nex3
Copy link
Member Author

nex3 commented Feb 24, 2020

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 nex3 closed this as completed Feb 24, 2020
@nex3 nex3 reopened this Feb 24, 2020
@jddeep
Copy link

jddeep commented Feb 25, 2020

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
Copy link
Member Author

nex3 commented Feb 25, 2020

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

@natebosch
Copy link
Member

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

@mosuem mosuem transferred this issue from dart-archive/path Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:path type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants