UriUtils ignores allowReservedCharacters=false when the input has no percent triplet · Issue #3625 · OpenFeign/feign · GitHub
Skip to content

UriUtils ignores allowReservedCharacters=false when the input has no percent triplet #3625

Open

Description

@hutiefang76

UriUtils.encode("a&b=c", false) returns a&b=c, whereas the corresponding call with an existing triplet, UriUtils.encode("a&b=c%20", false), encodes the raw reserved characters. The no-triplet branch in encodeInternal passes a hard-coded true to encodeChunk instead of the argument.

Expected: a%26b%3Dc when the flag is false; existing %XX triplets should still be preserved. The true-flag and flagless overloads keep their current behavior. This concerns the existing boolean contract, separate from #2002's discussion of double encoding.

Reproduced on current master with UriUtilsTest: 32 tests, four failures, no errors or skips. The failing cases include both boolean overloads and non-ASCII input. Main sources compile with JDK 8 and tests run with actual JDK 25 using the project's dev profile.

I will pass the flag through in that branch and add these regressions. The scope is UriUtils, its existing test suite, and the changelog; no URI-template expansion or query collection changes.

Reproduction and report prepared and posted by an AI assistant for @hutiefang76.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions