Skip to content

UriTemplate handles encoded variables improperly on expand call #1131

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

Closed
odrotbohm opened this issue Nov 28, 2019 · 0 comments
Closed

UriTemplate handles encoded variables improperly on expand call #1131

odrotbohm opened this issue Nov 28, 2019 · 0 comments
Assignees
Labels
in: core Core parts of the project type: bug
Milestone

Comments

@odrotbohm
Copy link
Member

odrotbohm commented Nov 28, 2019

Backport of #593.

@odrotbohm odrotbohm added type: bug in: core Core parts of the project labels Nov 28, 2019
@odrotbohm odrotbohm added this to the 1.0.2.RELEASE milestone Nov 28, 2019
@odrotbohm odrotbohm self-assigned this Nov 28, 2019
odrotbohm added a commit that referenced this issue Nov 28, 2019
…ings.

UriTemplate now uses UriBuilderFactory (DefaultUriBuilderFactory in particular) to expand templates. We inspect the given source URI string, try to decode it and configure the factory to only encode values if the decoded String is shorter than the source one as that indicates it already contains encoded characters.

The UriBuilderFactory is held as transient value as its implementations are usually not serializable in the first place. Added the necessary logic to recreate the factory instance on deserialization.

Added all expansion tests given in the original ticket as unit tests.
odrotbohm added a commit that referenced this issue Nov 28, 2019
Refactored existing unit tests to use the newly introduced test fixture type. Refactored ticket references to use the current style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Core parts of the project type: bug
Projects
None yet
Development

No branches or pull requests

1 participant