mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 05:49:04 +00:00
Fix double encoding in DefaultApiVersionInserter
Ensure that the DefaultApiVersionInserter does not re-encode existing parts of the input URI by using the 'encoded' flag in UriComponentsBuilder. This prevents percent-encoded characters (like %20) from being incorrectly double-encoded to %2520 during the version insertion process. See gh-36097 Signed-off-by: Nabil Fawwaz Elqayyim <master@nabilfawwaz.com>
This commit is contained in:
committed by
rstoyanchev
parent
1370a833ed
commit
e0db67aa3b
+2
-1
@@ -33,6 +33,7 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
* Default implementation of {@link ApiVersionInserter}.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Nabil Fawwaz Elqayyim
|
||||
* @since 7.0
|
||||
* @see DefaultApiVersionInserterBuilder
|
||||
*/
|
||||
@@ -81,7 +82,7 @@ final class DefaultApiVersionInserter implements ApiVersionInserter {
|
||||
builder.replacePath(null);
|
||||
pathSegments.forEach(builder::pathSegment);
|
||||
}
|
||||
return builder.build().toUri();
|
||||
return builder.build(true).toUri();
|
||||
}
|
||||
|
||||
private void assertPathSegmentIndex(Integer index, int pathSegmentsSize, URI uri) {
|
||||
|
||||
Reference in New Issue
Block a user