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

handle relative URLs for resolveURL #37

Closed
pi0 opened this issue Aug 17, 2021 · 2 comments · Fixed by #217 or #218
Closed

handle relative URLs for resolveURL #37

pi0 opened this issue Aug 17, 2021 · 2 comments · Fixed by #217 or #218

Comments

@pi0
Copy link
Member

pi0 commented Aug 17, 2021

Depends on #35, #36.

previous work: #15

resolveURL('foo/bar', '../baz') = 'foo/baz'
@shtse8
Copy link

shtse8 commented Jul 28, 2022

why not baz? because the first string without trailing slash. it may be a filename but not directory

foo/bar + ../ =

+ baz = baz

@pi0
Copy link
Member Author

pi0 commented Jul 29, 2022

in URL spec, file and directory are both part of path. This behavior is also consistent with URL:

// file://some/path/bar
new URL('../bar', 'file://some/path/foo/bar').toString()

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