diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch new file mode 100644 index 0000000000..8cab678a36 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-Fixed-32298-Fixed-URLValidator-hostname-length-valid.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From ee35cb8dd2f903ddde115ca10186e162ffd8dc62 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Sat, 26 Dec 2020 20:52:44 +0530 | ||
| 4 | Subject: [PATCH] Fixed #32298 -- Fixed URLValidator hostname length | ||
| 5 | validation. | ||
| 6 | |||
| 7 | From: Akshat1Nar <akshat.dixit71@gmail.com> | ||
| 8 | |||
| 9 | URLValidator now validates the maximum length of a hostname without | ||
| 10 | the userinfo and port. | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://github.com/django/django/commit/b41d38ae26b1da9519a6cd765bc2f2ce7d355007] | ||
| 13 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 14 | --- | ||
| 15 | django/core/validators.py | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/django/core/validators.py b/django/core/validators.py | ||
| 19 | index 2dbd3bf..94cc3bf 100644 | ||
| 20 | --- a/django/core/validators.py | ||
| 21 | +++ b/django/core/validators.py | ||
| 22 | @@ -151,7 +151,7 @@ class URLValidator(RegexValidator): | ||
| 23 | # section 3.1. It's defined to be 255 bytes or less, but this includes | ||
| 24 | # one byte for the length of the name and one byte for the trailing dot | ||
| 25 | # that's used to indicate absolute names in DNS. | ||
| 26 | - if len(urlsplit(value).netloc) > 253: | ||
| 27 | + if len(urlsplit(value).hostname) > 253: | ||
| 28 | raise ValidationError(self.message, code=self.code) | ||
| 29 | |||
| 30 | |||
