Skip to content

Fix percent encoding in relative path navigation#14786

Merged
brophdawg11 merged 4 commits into
remix-run:devfrom
veeceey:fix/issue-14510-percent-encoding
Mar 17, 2026
Merged

Fix percent encoding in relative path navigation#14786
brophdawg11 merged 4 commits into
remix-run:devfrom
veeceey:fix/issue-14510-percent-encoding

Conversation

@veeceey
Copy link
Copy Markdown
Contributor

@veeceey veeceey commented Feb 8, 2026

Fixes #14510

When navigating using relative links, path segments containing %25 (percent) were being left as raw % characters, causing decoding failures and browser refresh issues.

This fix adds encoding of % to %25 before encoding ? and # characters in the useRoutesImpl hook. The order is important to avoid double-encoding.

Test results: 114 test suites passed, 2429 tests passed including params-decode-test.tsx

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 8, 2026

🦋 Changeset detected

Latest commit: 4d8ec43

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

This PR includes changesets to release 11 packages
Name Type
react-router Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/dev Patch
react-router-dom Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-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

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented Feb 8, 2026

Hi @veeceey,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented Feb 8, 2026

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@brophdawg11
Copy link
Copy Markdown
Contributor

Can you add a test for this logic and point this to the dev branch?

@veeceey
Copy link
Copy Markdown
Contributor Author

veeceey commented Mar 10, 2026

Hey @brophdawg11, good call on both counts. I'll add a test case for the percent encoding fix and retarget the PR to dev. Will push the updates shortly.

@veeceey veeceey force-pushed the fix/issue-14510-percent-encoding branch from c76ea73 to a7515b7 Compare March 10, 2026 13:27
@veeceey veeceey changed the base branch from main to dev March 10, 2026 13:27
veeceey added 4 commits March 11, 2026 21:31
When navigating using relative links, path segments containing %25
(which decodes to %) were being left as raw % characters in the URI.
This caused decoding failures and browser refresh issues.

The fix adds encoding of % to %25 before encoding ? and # characters.
The order is important to avoid double-encoding.

Fixes remix-run#14510
@veeceey veeceey force-pushed the fix/issue-14510-percent-encoding branch from a7515b7 to 4d8ec43 Compare March 12, 2026 04:32
@brophdawg11 brophdawg11 merged commit 830d3ba into remix-run:dev Mar 17, 2026
5 of 11 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version 7.13.2-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version 7.13.2 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@singpolyma
Copy link
Copy Markdown

Fixed! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relative path navigation creates malformed URI segment when any segment contains %25

3 participants