Return true for static cloud metadata hostnames that should be treated like link-local metadata reach without performing DNS resolution.
(host: &str)
| 59 | /// Return true for static cloud metadata hostnames that should be treated like |
| 60 | /// link-local metadata reach without performing DNS resolution. |
| 61 | pub(crate) fn is_known_metadata_hostname(host: &str) -> bool { |
| 62 | let normalized = host.trim().trim_end_matches('.').to_ascii_lowercase(); |
| 63 | matches!(normalized.as_str(), "metadata.google.internal") |
| 64 | } |
| 65 | |
| 66 | fn is_link_local_or_metadata_host(host: &str) -> bool { |
| 67 | is_link_local(host) || is_known_metadata_hostname(host) |
no outgoing calls
no test coverage detected