Fix UriComponentsBuilder.fromUriString parsing error

This commit fixes cases where part of the URI was mistaken for the
userinfo when:
* the URI did not contain any path
* the query string contained the "@"

Issue: SPR-11964
This commit is contained in:
Brian Clozel
2014-07-09 16:58:11 +02:00
parent bc62d63fdd
commit a4484bb767
2 changed files with 13 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ public class UriComponentsBuilder {
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 = "[^\\[/?#:]*";