-
Notifications
You must be signed in to change notification settings - Fork 45
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
fix: normalizeURL
does not ensure path name starts with a /
#177
Comments
Hi. Can you please share the context of this issue and did you find any standards that specify a valid URL needs one trailing slash at least? (because browser URL, doesn'y do it, but |
I just expected to happen what's written in the README of this project. I'm not sure about standards and thus am fine with changing the README too to reflect the actual behavior of |
I agree the README should be updated, because Had to add this in my own project: const normalizedURL = normalizeURL(url);
const { host, pathname, search } = parseURL(normalizedURL);
const pathnameCleaned = pathname === '' ? '/' : pathname; |
Docs updated in the meantime and for v2 it is likely this behavior changes (~>#208). If v1 was not widely used, I would add it as a fix but this fix has potential of breaking some other cases. (closing to track from one place for all side-effects in v2) |
Environment
Reproduction
https://stackblitz.com/edit/stackblitz-starters-rbpv5q?file=index.mjs
Describe the bug
The example in the README does not work as specified.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: