Skip to content

Reject trailing newlines in hostnames and ports - #513

Open
xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix/validators-strict-identifiers-20261013
Open

xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix/validators-strict-identifiers-20261013

Conversation

@xiehuanyi

Copy link
Copy Markdown
Contributor

hostname("ubuntu-pc\n") and host/port values such as hostname("[::1]:22\n") currently validate as True. The $ anchor permits a match before a final newline.

Use full matches for simple hosts and port values. Add six regression cases covering simple names, domains, IPv4 and bracketed IPv6. All six fail before this change. The complete suite passes (1119 tests), as do Ruff and Pyright checks.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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