diff --git a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java index b05112c65315..611bb15da434 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java @@ -73,19 +73,19 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable { private static final Pattern QUERY_PARAM_PATTERN = Pattern.compile("([^&=]+)(=?)([^&]+)?"); - private static final String SCHEME_PATTERN = "([^:/?#]+):"; + private static final String SCHEME_PATTERN = "([^:/?#\\\\]+):"; private static final String HTTP_PATTERN = "(?i)(http|https):"; - private static final String USERINFO_PATTERN = "([^/?#]*)"; + private static final String USERINFO_PATTERN = "([^/?#\\\\]*)"; - private static final String HOST_IPV4_PATTERN = "[^/?#:]*"; + private static final String HOST_IPV4_PATTERN = "[^/?#:\\\\]*"; private static final String HOST_IPV6_PATTERN = "\\[[\\p{XDigit}:.]*[%\\p{Alnum}]*]"; private static final String HOST_PATTERN = "(" + HOST_IPV6_PATTERN + "|" + HOST_IPV4_PATTERN + ")"; - private static final String PORT_PATTERN = "(\\{[^}]+\\}?|[^/?#]*)"; + private static final String PORT_PATTERN = "(\\{[^}]+\\}?|[^/?#\\\\]*)"; private static final String PATH_PATTERN = "([^?#]*)";