MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / isMetadataAddress

Function isMetadataAddress

server/modules/outboundTargetPolicy.js:170–184  ·  view source on GitHub ↗
(address)

Source from the content-addressed store, hash-verified

168}
169
170function 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
186function getMappedIpv4(address) {
187 if (address.startsWith("::ffff:")) {

Callers 1

validateOutboundUrlFunction · 0.85

Calls 1

getNat64EmbeddedIpv4Function · 0.85

Tested by

no test coverage detected