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

fix: infinite redirect on URL with special characters #1472

Merged
merged 7 commits into from
Aug 1, 2022
Merged

Conversation

rchl
Copy link
Collaborator

@rchl rchl commented Jul 31, 2022

For the currently loaded route, when Nuxt.js resolves the route, it passes "normalized" URL to router.resolve. This results in resolved route returning that normalized URL. In the case of the original issue the initial URL /foo-&/1 would get normalized to /foo-%26/1. This created discrepancy when comparing path of the route resolved by this module. Since this module did not normalize the URL, the returned path would be different (encoded vs. decoded char) and the module would attempt to redirect indefinitely.

This is caused by a change introduced in some newer version of ufo.

Fix by using same normalization logic when comparing the current route and the route we are redirecting to.

Resolves #1469

rchl added 7 commits July 31, 2022 21:56
* origin/main:
  refactor: require minimum node 14 (#1473)
* main:
  chore(deps): update devdependency @release-it/conventional-changelog to v5 (#1434)
  chore(deps): update devdependency release-it to v15 (#1435)
  chore(deps): disable updates of the node engine
* main:
  chore(deps): update all non-major dependencies
  chore(deps): update devdependency @nuxtjs/eslint-config-typescript to v10
@rchl rchl changed the title fix: normalize URL resolved by vue-router to match what Nuxt is doing fix: infinite redirect on URL with special characters Aug 1, 2022
@rchl rchl merged commit 426af76 into main Aug 1, 2022
@rchl rchl deleted the fix/resolve-url branch August 1, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERR_TOO_MANY_REDIRECTS error in specific i18n condition
1 participant