(address)
| 168 | } |
| 169 | |
| 170 | function isMetadataAddress(address) { |
| 171 | if (METADATA_IP_ADDRESSES.has(address)) return true; |
| 172 | |
| 173 | if (address.startsWith("::ffff:")) { |
| 174 | const mappedIpv4 = address.replace("::ffff:", ""); |
| 175 | return METADATA_IP_ADDRESSES.has(mappedIpv4); |
| 176 | } |
| 177 | |
| 178 | const nat64Ipv4 = getNat64EmbeddedIpv4(address); |
| 179 | if (nat64Ipv4) { |
| 180 | return METADATA_IP_ADDRESSES.has(nat64Ipv4); |
| 181 | } |
| 182 | |
| 183 | return false; |
| 184 | } |
| 185 | |
| 186 | function getMappedIpv4(address) { |
| 187 | if (address.startsWith("::ffff:")) { |
no test coverage detected