Skip to content

Commit

Permalink
Merge branch '5.2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Jun 26, 2020
2 parents 115ea25 + 9876ca0 commit ba5f4f5
Show file tree
Hide file tree
Showing 2 changed files with 178 additions and 87 deletions.
Expand Up @@ -60,6 +60,7 @@
* @author Oliver Gierke
* @author Brian Clozel
* @author Sebastien Deleuze
* @author Sam Brannen
* @since 3.1
* @see #newInstance()
* @see #fromPath(String)
Expand Down Expand Up @@ -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 = "\"?([^;,\"]+)\"?";

Expand Down Expand Up @@ -293,6 +294,10 @@ public static UriComponentsBuilder fromHttpUrl(String httpUrl) {
}
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 {
Expand Down

0 comments on commit ba5f4f5

Please sign in to comment.