Merge pull request #21721 from netbox-community/21698-custom-field-url-filter-is-too-restrictive-for-weird-ports

Fixes #21698: Fix validation of custom field URLs with single-digit ports
This commit is contained in:
bctiemann
2026-03-24 14:25:00 -04:00
committed by GitHub

View File

@@ -34,7 +34,7 @@ class EnhancedURLValidator(URLValidator):
r'^(?:[a-z0-9\.\-\+]*)://' # Scheme (enforced separately)
r'(?:\S+(?::\S*)?@)?' # HTTP basic authentication
r'(?:' + '|'.join(host_res) + ')' # IPv4, IPv6, FQDN, or hostname
r'(?::\d{2,5})?' # Port number
r'(?::\d{1,5})?' # Port number
r'(?:[/?#][^\s]*)?' # Path
r'\Z', re.IGNORECASE)
schemes = None