mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Merge branch '7.0.x'
This commit is contained in:
@@ -178,7 +178,7 @@ abstract class RfcUriParser {
|
||||
parser.capturePath().advanceTo(QUERY, i + 1);
|
||||
break;
|
||||
case '#':
|
||||
parser.capturePath().advanceTo(FRAGMENT);
|
||||
parser.capturePath().advanceTo(FRAGMENT, i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +270,27 @@ class UriComponentsBuilderTests {
|
||||
UriComponentsBuilder.fromUriString("http://[1abc:2abc:3abc::5ABC:6abc:8080/resource", parserType));
|
||||
}
|
||||
|
||||
@ParameterizedTest // gh-36759
|
||||
@EnumSource
|
||||
void fromUriStringRelativeUriWithFragment(ParserType parserType) {
|
||||
UriComponents result = UriComponentsBuilder.fromUriString("path2#foo", parserType).build();
|
||||
assertThat(result.getScheme()).isNull();
|
||||
assertThat(result.getHost()).isNull();
|
||||
assertThat(result.getPath()).isEqualTo("path2");
|
||||
assertThat(result.getFragment()).isEqualTo("foo");
|
||||
assertThat(result.toUriString()).isEqualTo("path2#foo");
|
||||
}
|
||||
|
||||
@ParameterizedTest // gh-36759
|
||||
@EnumSource
|
||||
void fromUriStringRelativeUriWithEmptyFragment(ParserType parserType) {
|
||||
UriComponents result = UriComponentsBuilder.fromUriString("path2#", parserType).build();
|
||||
assertThat(result.getScheme()).isNull();
|
||||
assertThat(result.getHost()).isNull();
|
||||
assertThat(result.getPath()).isEqualTo("path2");
|
||||
assertThat(result.getFragment()).isNull();
|
||||
}
|
||||
|
||||
@ParameterizedTest // see SPR-11970
|
||||
@EnumSource
|
||||
void fromUriStringNoPathWithReservedCharInQuery(ParserType parserType) {
|
||||
|
||||
Reference in New Issue
Block a user