Limit scheme/host check in fromUriString to HTTP URLs
Closes gh-26258
This commit is contained in:
parent
d3e1c54354
commit
f07fc76cf3
|
@ -252,8 +252,8 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
|
||||||
builder.schemeSpecificPart(ssp);
|
builder.schemeSpecificPart(ssp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (StringUtils.hasLength(scheme) && !StringUtils.hasLength(host)) {
|
if (StringUtils.hasLength(scheme) && scheme.startsWith("http") && !StringUtils.hasLength(host)) {
|
||||||
throw new IllegalArgumentException("[" + uri + "] is not a valid URI");
|
throw new IllegalArgumentException("[" + uri + "] is not a valid HTTP URL");
|
||||||
}
|
}
|
||||||
builder.userInfo(userInfo);
|
builder.userInfo(userInfo);
|
||||||
builder.host(host);
|
builder.host(host);
|
||||||
|
|
Loading…
Reference in New Issue