urlparse:
https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse
In case of url like
{{{
urlparse('https://username1:pass...@example.com/foo')
}}}
the parse result is:
{{{
ParseResult(scheme='https', netloc='username1:pass...@example.com',
path='/foo', params='', query='', fragment='')
}}}
with the username and password in netloc.
Of course if the netloc is too long only because of the password, this
causes a valid URL to be not accepted.
The test for length is a requirement for the hostname, so it should test
.hostname instead of .netloc
--
Ticket URL: <https://code.djangoproject.com/ticket/32298>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Cleanup/optimization
* version: 3.1 => master
* component: Uncategorized => Core (Other)
* easy: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:1>
* owner: nobody => Akshat Dixit
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:2>
* has_patch: 0 => 1
* needs_tests: 0 => 1
* stage: Accepted => Ready for checkin
Comment:
https://github.com/django/django/pull/13811
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:3>
* stage: Ready for checkin => Accepted
Comment:
This ticket is not ready for checkin (see
[https://docs.djangoproject.com/en/3.1/internals/contributing/triaging-
tickets/#triage-stages Triage stages]). Also you shouldn't mark your own
patches as ready for checkin.
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:4>
Comment (by Akshat Dixit):
Replying to [comment:4 Mariusz Felisiak]:
> This ticket is not ready for checkin (see
[https://docs.djangoproject.com/en/3.1/internals/contributing/triaging-
tickets/#triage-stages Triage stages]). Also you shouldn't mark your own
patches as ready for checkin.
I am sorry, I did not understand the terminology correctly. Thankyou for
your correction.
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:5>
Comment (by Akshat Dixit):
Hello, Can someone help me in progressing this patch. I have submitted a
patch which has passed all the build tests. I will also like to write
tests for this bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:6>
Comment (by Claude Paroz):
The next step is to write a test, you may need to explore a bit the
`tests` folder of Django to find out where other URL validation tests are
located.
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:7>
Comment (by Akshat Dixit):
Added test of this case to
{{{
tests/validators/tests.py
}}}
where all other url validation tests are present and committed changes to
same pull request. https://github.com/django/django/pull/13811.
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:8>
* needs_tests: 1 => 0
Comment:
Tests and patch availabe at
> https://github.com/django/django/pull/13811
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:9>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:10>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"b41d38ae26b1da9519a6cd765bc2f2ce7d355007" b41d38a]:
{{{
#!CommitTicketReference repository=""
revision="b41d38ae26b1da9519a6cd765bc2f2ce7d355007"
Fixed #32298 -- Fixed URLValidator hostname length validation.
URLValidator now validates the maximum length of a hostname without
the userinfo and port.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32298#comment:11>