summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAkshat1Nar <akshat.dixit71@gmail.com>2020-12-26 20:52:44 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-04 09:25:40 +0100
commitb41d38ae26b1da9519a6cd765bc2f2ce7d355007 (patch)
tree231d0406b9980aeb3adc49531d4184965831e05a /django
parent966ed414b2adfc9ecc26a9d529dec99d94262cd9 (diff)
Fixed #32298 -- Fixed URLValidator hostname length validation.
URLValidator now validates the maximum length of a hostname without the userinfo and port.
Diffstat (limited to 'django')
-rw-r--r--django/core/validators.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/validators.py b/django/core/validators.py
index 830b533848..a385819510 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -138,7 +138,7 @@ class URLValidator(RegexValidator):
# section 3.1. It's defined to be 255 bytes or less, but this includes
# one byte for the length of the name and one byte for the trailing dot
# that's used to indicate absolute names in DNS.
- if len(urlsplit(value).netloc) > 253:
+ if len(urlsplit(value).hostname) > 253:
raise ValidationError(self.message, code=self.code, params={'value': value})