Browse Source

Remove unused method in UriComponentsBuilder

This commit removes HierarchicalUriComponents#checkSchemeAndHost
unused private method.

Closes gh-33684
pull/33703/head
海子 Yang 1 year ago committed by Sébastien Deleuze
parent
commit
3984266295
  1. 9
      spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java

9
spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java

@ -243,15 +243,6 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable { @@ -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

Loading…
Cancel
Save