python-hyper / hyperlink

🔗 Immutable, Pythonic, correct URLs.
https://hyperlink.readthedocs.io/
Other
283 stars 41 forks source link

Fix non-numeric port number bug (addresses #180) #179

Open kenballus opened 1 year ago

kenballus commented 1 year ago

This isn't supposed to work:

import hyperlink
hyperlink.URL.from_text("http://example.com:-80")

This patch ensures that only valid port strings are accepted.

(The root cause of this is that port numbers are parsed using int. Both cpython and rfc3986 also had this bug.)

kenballus commented 1 year ago

Addresses #180

kenballus commented 2 months ago

Any update on this? Thanks!