Remove unused method in UriComponentsBuilder

This commit removes HierarchicalUriComponents#checkSchemeAndHost
unused private method.

Closes gh-33684
This commit is contained in:
海子 Yang 2024-10-11 20:57:38 +08:00 committed by Sébastien Deleuze
parent a75f22e548
commit 3984266295
1 changed files with 0 additions and 9 deletions

View File

@ -243,15 +243,6 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
return fromUriString(httpUrl);
}
private static void checkSchemeAndHost(String uri, @Nullable String scheme, @Nullable String host) {
if (StringUtils.hasLength(scheme) && scheme.startsWith("http") && !StringUtils.hasLength(host)) {
throw new IllegalArgumentException("[" + uri + "] is not a valid HTTP URL");
}
if (StringUtils.hasLength(host) && host.startsWith("[") && !host.endsWith("]")) {
throw new IllegalArgumentException("Invalid IPV6 host in [" + uri + "]");
}
}
/**
* Create a new {@code UriComponents} object from the URI associated with
* the given HttpRequest while also overlaying with values from the headers