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

Function isPrivateOrReservedAddress

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

Source from the content-addressed store, hash-verified

192}
193
194function isPrivateOrReservedAddress(address) {
195 const mappedIpv4 = getMappedIpv4(address);
196 if (mappedIpv4) {
197 return PRIVATE_IPV4_BLOCKLIST.check(mappedIpv4, "ipv4");
198 }
199
200 const family = net.isIP(address);
201 if (family === 4) {
202 return PRIVATE_IPV4_BLOCKLIST.check(address, "ipv4");
203 }
204 if (family === 6) {
205 return PRIVATE_IPV6_BLOCKLIST.check(address, "ipv6");
206 }
207 return false;
208}
209
210function createPolicyLogPayload(url, context, reason, extra = {}) {
211 return {

Callers 1

validateOutboundUrlFunction · 0.85

Calls 1

getMappedIpv4Function · 0.85

Tested by

no test coverage detected