|
|
@ -182,7 +182,8 @@ final class HierarchicalUriComponents extends UriComponents { |
|
|
|
} |
|
|
|
} |
|
|
|
String encodedScheme = encodeUriComponent(this.getScheme(), encoding, Type.SCHEME); |
|
|
|
String encodedScheme = encodeUriComponent(this.getScheme(), encoding, Type.SCHEME); |
|
|
|
String encodedUserInfo = encodeUriComponent(this.userInfo, encoding, Type.USER_INFO); |
|
|
|
String encodedUserInfo = encodeUriComponent(this.userInfo, encoding, Type.USER_INFO); |
|
|
|
String encodedHost = encodeUriComponent(this.host, encoding, Type.HOST); |
|
|
|
String encodedHost = encodeUriComponent(this.host, encoding, getHostType()); |
|
|
|
|
|
|
|
|
|
|
|
PathComponent encodedPath = this.path.encode(encoding); |
|
|
|
PathComponent encodedPath = this.path.encode(encoding); |
|
|
|
MultiValueMap<String, String> encodedQueryParams = |
|
|
|
MultiValueMap<String, String> encodedQueryParams = |
|
|
|
new LinkedMultiValueMap<String, String>(this.queryParams.size()); |
|
|
|
new LinkedMultiValueMap<String, String>(this.queryParams.size()); |
|
|
@ -240,6 +241,9 @@ final class HierarchicalUriComponents extends UriComponents { |
|
|
|
return bos.toByteArray(); |
|
|
|
return bos.toByteArray(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Type getHostType() { |
|
|
|
|
|
|
|
return ((this.host != null) && this.host.startsWith("[")) ? Type.HOST_IPV6 : Type.HOST_IPV4; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// verifying
|
|
|
|
// verifying
|
|
|
|
|
|
|
|
|
|
|
@ -254,7 +258,7 @@ final class HierarchicalUriComponents extends UriComponents { |
|
|
|
} |
|
|
|
} |
|
|
|
verifyUriComponent(getScheme(), Type.SCHEME); |
|
|
|
verifyUriComponent(getScheme(), Type.SCHEME); |
|
|
|
verifyUriComponent(userInfo, Type.USER_INFO); |
|
|
|
verifyUriComponent(userInfo, Type.USER_INFO); |
|
|
|
verifyUriComponent(host, Type.HOST); |
|
|
|
verifyUriComponent(host, getHostType()); |
|
|
|
this.path.verify(); |
|
|
|
this.path.verify(); |
|
|
|
for (Map.Entry<String, List<String>> entry : queryParams.entrySet()) { |
|
|
|
for (Map.Entry<String, List<String>> entry : queryParams.entrySet()) { |
|
|
|
verifyUriComponent(entry.getKey(), Type.QUERY_PARAM); |
|
|
|
verifyUriComponent(entry.getKey(), Type.QUERY_PARAM); |
|
|
@ -462,12 +466,18 @@ final class HierarchicalUriComponents extends UriComponents { |
|
|
|
return isUnreserved(c) || isSubDelimiter(c) || ':' == c; |
|
|
|
return isUnreserved(c) || isSubDelimiter(c) || ':' == c; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
HOST { |
|
|
|
HOST_IPV4 { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean isAllowed(int c) { |
|
|
|
public boolean isAllowed(int c) { |
|
|
|
return isUnreserved(c) || isSubDelimiter(c); |
|
|
|
return isUnreserved(c) || isSubDelimiter(c); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
HOST_IPV6 { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean isAllowed(int c) { |
|
|
|
|
|
|
|
return isUnreserved(c) || isSubDelimiter(c) || '[' == c || ']' == c || ':' == c; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
PORT { |
|
|
|
PORT { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean isAllowed(int c) { |
|
|
|
public boolean isAllowed(int c) { |
|
|
|