mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-10-23 14:22:22 +00:00
sync: use explicit CGN network check in validate_external_url (from PR #140)
Replace is_global fallback with canonical _CGN_NETWORK constant check to stay consistent with PR #140's approach across all post-140 branches.
This commit is contained in:
1 parent
db0e1c6539
commit
2a80f76432
1 file changed
+2
@@ -111,10 +111,12 @@ def validate_external_url(
|
||||
logger.warning(f"URL resolves to private/internal IP: {ip}")
|
||||
return False
|
||||
|
||||
# Reject CGN (Carrier-Grade NAT) - RFC 6598
|
||||
if ip_obj in _CGN_NETWORK:
|
||||
logger.warning(f"URL resolves to CGN IP: {ip}")
|
||||
return False
|
||||
|
||||
# Reject reserved ranges
|
||||
if ip_obj.is_reserved or ip_obj.is_multicast:
|
||||
logger.warning(f"URL resolves to reserved/multicast IP: {ip}")
|
||||
return False
|
||||
|
||||
Reference in new issue
Block a user