Follow-up fix for recent change to PORT_PATTERN

The pattern was changed in 65797d04f2
to check for characters up until "/", instead of for digits, but now
also checks up until "?" and "#".

Closes gh-26905
This commit is contained in:
Rossen Stoyanchev
2021-05-10 07:18:50 +01:00
parent eb03144e9d
commit 0468ef46ac
2 changed files with 15 additions and 1 deletions

View File

@@ -85,7 +85,7 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
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 = "([^?#]*)";