-
Notifications
You must be signed in to change notification settings - Fork 189
fix: preserve URL-encoded characters in wildcard route parameters #22791
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
base: main
Are you sure you want to change the base?
Conversation
Fixes #19788 Changes: - Client: Remove premature decoding of pathname in Flow.ts to preserve encoded characters like %2F in the URL sent to server - Server: Add PathUtil.getSegmentsListWithDecoding() method that splits path by "/" then decodes each segment individually - Server: Update RouteSegment to use segment decoding for route matching This fix ensures that URL-encoded slashes (%2F) and other special characters in wildcard parameters are properly decoded while still distinguishing them from literal path separators. For example: - /wild/a/b/c creates 3 segments: ["a", "b", "c"] - /wild/a%2Fb%2Fc creates 1 segment that decodes to: ["a/b/c"] Previously, the client decoded the entire pathname causing %2F to become "/" which the server then incorrectly split as path segments, resulting in data loss. Tests added: - PathUtil segment decoding with various encoded characters - Wildcard parameter routing with encoded slashes and special chars - URL generation documentation for pre-encoding requirements
Test Results1 243 files - 65 1 243 suites - 65 1h 8m 40s ⏱️ - 7m 35s For more details on these failures, see this check. Results for commit d973b4b. ± Comparison against base commit 54ea58c. This pull request removes 125 and adds 18 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Format Checker Report
Here is the list of files with format issues in your PR: |
|




Fixes #19788
Changes:
This fix ensures that URL-encoded slashes (%2F) and other special characters in wildcard parameters are properly decoded while still distinguishing them from literal path separators. For example:
Previously, the client decoded the entire pathname causing %2F to become "/" which the server then incorrectly split as path segments, resulting in data loss.
Tests added: