Repository navigation
Fix URI fragment replacement and preserve target escapes - #3633
Open
hutiefang76 wants to merge 1 commit into
Open
hutiefang76 wants to merge 1 commit into
hutiefang76 wants to merge 1 commit into
Conversation
A replacement URI should not retain a fragment from the previous URI. Keep the fragment during template resolution and preserve percent escapes in target fragments so they remain valid URL text. Fixes OpenFeign#3095
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3095.
Replacing
/old#stalewith/new?q=vretained#stale, with no API to clear it completely. A target such ashttps://example.com/a#encoded%20value%2Falso lost its percent escapes because the decoded fragment was appended to the URL.This clears the old fragment on URI replacement and preserves raw target fragments. Append behavior, explicit empty fragments, copying, and normal template resolution retain their existing behavior. The internal resolve path carries the separately stored fragment forward. No public setter or dependency is added.
Nine tests cover both failures and those controls; the changelog records the replacement semantics for 13.18.
Validation on macOS ARM64, using a fixed JDK 8 toolchain for main sources and an actual Temurin JDK 25.0.4.1 toolchain for test compilation/execution:
./mvnw -Pdev -pl core clean verify: 781 tests, 0 failures/errors, 4 existing conditional skips. All 58 RequestTemplate tests pass../mvnw -Pdev validate: passes with the required JDK 8/11/25 toolchains.Checks ran in an independent checkout of the same base because the license plugin's JGit failed on a Git worktree. License and formatter checks remained enabled; all three tested file hashes match the submitted files. Local toolchain configuration is not part of the patch.
AI assistance: DeepSeek assisted implementation and first-pass review; Codex coordinated reproduction, actual validation, and final diff review.