Merge branch '5.2.x'

This commit is contained in:
Sam Brannen
2020-06-26 18:31:07 +02:00
2 changed files with 178 additions and 87 deletions

View File

@@ -60,6 +60,7 @@ import org.springframework.web.util.UriComponents.UriTemplateVariables;
* @author Oliver Gierke
* @author Brian Clozel
* @author Sebastien Deleuze
* @author Sam Brannen
* @since 3.1
* @see #newInstance()
* @see #fromPath(String)
@@ -96,7 +97,7 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
private static final Pattern HTTP_URL_PATTERN = Pattern.compile(
"^" + HTTP_PATTERN + "(//(" + USERINFO_PATTERN + "@)?" + HOST_PATTERN + "(:" + PORT_PATTERN + ")?" + ")?" +
PATH_PATTERN + "(\\?" + LAST_PATTERN + ")?");
PATH_PATTERN + "(\\?" + QUERY_PATTERN + ")?" + "(#" + LAST_PATTERN + ")?");
private static final String FORWARDED_VALUE = "\"?([^;,\"]+)\"?";
@@ -293,6 +294,10 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
}
builder.path(matcher.group(8));
builder.query(matcher.group(10));
String fragment = matcher.group(12);
if (StringUtils.hasText(fragment)) {
builder.fragment(fragment);
}
return builder;
}
else {