Skip to content

Comments

Fix percent encoding in relative path navigation#14786

Open
veeceey wants to merge 3 commits intoremix-run:mainfrom
veeceey:fix/issue-14510-percent-encoding
Open

Fix percent encoding in relative path navigation#14786
veeceey wants to merge 3 commits intoremix-run:mainfrom
veeceey:fix/issue-14510-percent-encoding

Conversation

@veeceey
Copy link

@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

changeset-bot bot commented Feb 8, 2026

🦋 Changeset detected

Latest commit: c76ea73

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
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
Contributor

remix-cla-bot bot commented Feb 8, 2026

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

veeceey and others added 3 commits February 16, 2026 15:57
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 f48505c to c76ea73 Compare February 16, 2026 23:57
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

1 participant