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 redirect when containing "+" and decode values for URLSearchParams #603

Merged
merged 11 commits into from
Oct 31, 2024
Merged

Fix redirect when containing "+" and decode values for URLSearchParams #603

merged 11 commits into from
Oct 31, 2024

Conversation

john-trieu-nguyen
Copy link
Contributor

Ran into a bug when using next.config.js redirects.

An example configuration causing a failed redirect (404 error):

{
  source: '/foo',
  destination: '/search?bar=hello+world&baz=new%2C+earth',
  permanent: true
}

Without encoding the "+", the redirect will fail.
Also updated convertToQueryString to decode the values when appending to URLSearchParams as per spec.

Copy link

changeset-bot bot commented Oct 28, 2024

🦋 Changeset detected

Latest commit: 8628f5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch
app-router Patch

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

Copy link

pkg-pr-new bot commented Oct 29, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@603

commit: 8628f5b

Copy link
Contributor

@khuezy khuezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cannot pass with this

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks

@conico974 conico974 merged commit 77d87e7 into opennextjs:main Oct 31, 2024
3 checks passed
@github-actions github-actions bot mentioned this pull request Oct 30, 2024
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.

3 participants