function isOriginIPPotentiallyTrustworthy (origin) {
  // IPv6
  if (origin.includes(':')) {
    // Remove brackets from IPv6 addresses
    if (origin[0] === '[' && origin[origin.length - 1] === ']') {
      origin = origin.slice(1, -1)
    }
    return potentialleTrustworthyIPv6RegExp.test(origin)
  }

  // IPv4
  return potentialleTrustworthyIPv4RegExp.test(origin)
}
Check if host matches one of the CIDR notations 127.0.0.0/8 or ::1/128.

@param {string} origin
@returns {boolean}