diff --git a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java index 028d0e8695f3..f436bc2e96e3 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java @@ -243,15 +243,6 @@ public static UriComponentsBuilder fromHttpUrl(String httpUrl) throws InvalidUrl 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