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

Empty path navigates up the hierarchy? #157

Closed
jho406 opened this issue Sep 13, 2018 · 1 comment
Closed

Empty path navigates up the hierarchy? #157

jho406 opened this issue Sep 13, 2018 · 1 comment
Labels

Comments

@jho406
Copy link

jho406 commented Sep 13, 2018

Hi

I was expecting this library to closely mimic how fetch parses relative paths, so I'm not quite sure if this is a bug or maybe my expectation is wrong. Here's an example:

parse("", "http://foo.com/a/b/c")

Navigates up the hierarchy and produces:
"http://foo.com/a/b"

But I was expecting the path remain unchanged http://foo.com/a/b/c. Here's an example with fetch(''):

Assuming i'm already on http://foo.com/a/b/c

fetch('')

would init a request for "http://foo.com/a/b/c"

Thoughts?

@lpinca
Copy link
Member

lpinca commented Sep 14, 2018

This is a bug, the parsed pathname should be '/a/b/c'. I think the edge case where the url is the empty string is not handled correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants