Repository navigation
Fix double slash normalization for useNavigate paths with colons - #14718
Conversation
🦋 Changeset detectedLatest commit: 0571de6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| if (toPathname) { | ||
| if (isAbsoluteUrl(toPathname)) { | ||
| pathname = toPathname; | ||
| toPathname = toPathname.replace(/\/\/+/g, "/"); |
There was a problem hiding this comment.
We didn't need to be checking for absolute URLs at all here before. resolvePath is only intended to manage pathnames/search/hash - absolute navigations are handled outside of here by Link so we can just always do the double slash replacement here.
There was a problem hiding this comment.
is it intended that navigate("https://<absolute path>") doesn't work now? because it used to work before this change and it was a breaking change for us.
There was a problem hiding this comment.
Same, this was surprising, especially since it's not mentioned anywhere in the changelog or docs.
To be clear, I think it makes sense that it wouldn't handle absolute links. But this is definitely a breaking change that should've been noted somewhere.
./
#14711
845c467 to
fbd3ef8
Compare
|
🤖 Hello there, We just published version Thanks! |
|
🤖 Hello there, We just published version Thanks! |
…emix-run#14718) * Fix double slash normalization or useNavigate colon paths * Add test
Closes #14711
This is a rework of the solution from #14529 that removes the absolute path check because
resolvePathdoesn't need to handle absolute URLs.