Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kenballus
Copy link

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 kenballus changed the title Fix non-numeric port number bug Fix non-numeric port number bug (#180) Feb 7, 2023
@kenballus kenballus changed the title Fix non-numeric port number bug (#180) Fix non-numeric port number bug (addresses #180) Feb 7, 2023
@kenballus
Copy link
Author

Addresses #180

Copy link
Member

@mahmoud mahmoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Just one question/thought for now. Thanks for this!

src/hyperlink/_url.py Outdated Show resolved Hide resolved
…thon. changed an error message. fixed negative default port bug
Copy link
Member

@mahmoud mahmoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for addressing the feedback so quickly!

@kenballus
Copy link
Author

Any update on this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants