From 583a00cbbd76db003d943b0c4ca3680ef7e4ca14 Mon Sep 17 00:00:00 2001 From: bg0d-droid Date: Wed, 3 Jun 2026 00:12:01 +0800 Subject: [PATCH] Clarify HostSpecifier URI parser compatibility --- android/guava/src/com/google/common/net/HostSpecifier.java | 7 +++++++ guava/src/com/google/common/net/HostSpecifier.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/android/guava/src/com/google/common/net/HostSpecifier.java b/android/guava/src/com/google/common/net/HostSpecifier.java index 51d80fbcc218..4be093e6ae0b 100644 --- a/android/guava/src/com/google/common/net/HostSpecifier.java +++ b/android/guava/src/com/google/common/net/HostSpecifier.java @@ -30,6 +30,13 @@ * URI, the domain name case is further restricted to include only those domain names which end in a * recognized public suffix; see {@link InternetDomainName#isPublicSuffix()} for details. * + *

In this context, "URI" is used in the general sense, and {@code HostSpecifier} does not + * guarantee that every URI or URL parser will accept the original input without additional + * normalization. {@code HostSpecifier} follows the syntactic rules of {@link InetAddresses} and + * {@link InternetDomainName}, including their documented acceptance of some inputs that particular + * URI implementations may reject, such as non-ASCII digits, non-ASCII domain names, or domain + * labels containing underscores. + * *

Note that no network lookups are performed by any {@code HostSpecifier} methods. No attempt is * made to verify that a provided specifier corresponds to a real or accessible host. Only syntactic * and pattern-based checks are performed. diff --git a/guava/src/com/google/common/net/HostSpecifier.java b/guava/src/com/google/common/net/HostSpecifier.java index 51d80fbcc218..4be093e6ae0b 100644 --- a/guava/src/com/google/common/net/HostSpecifier.java +++ b/guava/src/com/google/common/net/HostSpecifier.java @@ -30,6 +30,13 @@ * URI, the domain name case is further restricted to include only those domain names which end in a * recognized public suffix; see {@link InternetDomainName#isPublicSuffix()} for details. * + *

In this context, "URI" is used in the general sense, and {@code HostSpecifier} does not + * guarantee that every URI or URL parser will accept the original input without additional + * normalization. {@code HostSpecifier} follows the syntactic rules of {@link InetAddresses} and + * {@link InternetDomainName}, including their documented acceptance of some inputs that particular + * URI implementations may reject, such as non-ASCII digits, non-ASCII domain names, or domain + * labels containing underscores. + * *

Note that no network lookups are performed by any {@code HostSpecifier} methods. No attempt is * made to verify that a provided specifier corresponds to a real or accessible host. Only syntactic * and pattern-based checks are performed.