Skip to content

fix: UriTemplate expansion reserved ("+") and fragment("#") should not encode already percent encoded parts #2108

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alexander-asenov
Copy link

Currently the UriTemplate::expand method re-encodes already percent encoded triplets when using reserved("+") and fragment ("#") expansions, which should not be the case according to the RFC 6570.

The fix adds a new Encoder(PercentEncodedEscaper) that escapes already percent encoded parts of the input. It takes in the constructor another Escaper, allowing extensions of already existing Escapers, without changing/breaking any existing implementations.

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #2107 ☕️

@alexander-asenov alexander-asenov requested a review from a team as a code owner June 30, 2025 17:10
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UriTemplate expansion reserved ("+") and fragment("#") should not encode already percent encoded parts
1 participant