The urlparse library incorrectly accepts a URI which specifies an invalid host identifier.
Example:
http://www.example.com:/abc
Looking at the URI specifications, this is an invalid URI.
By definition, you are supposed to specify a "hostport" and a hostport is defined as:
https://www.w3.org/Addressing/URL/uri-spec.html
hostport
host [ : port ]
The BNF indicates that : is only valid if a port is also specified.
See current behavior; I submit to you that this should generate an exception.
https://gist.github.com/anonymous/8504f160ff90649890b5a2a82f8028b0 |