1. 9
  1.  

  2. 6

    This wouldn’t have passed code review.

    Both the APIs throw exceptions if the URL fails the rules. There’s no security boundary. url and its type are valid on both sides of the system.

    Future You must now remember to use the PrivateNetworkGuard APIs in every place where URLs are brought into the system. And if Future You forgets— even once— the system will continue on happily. A recipe for vulnerabilities.