Skip to content

feat(atc): enforce RFC 1123 TLD all-numeric rejection in IsHostName#365

Merged
davidkallesen merged 1 commit into
mainfrom
feature/support-RFC-1123-for-IsHostName
Jun 24, 2026
Merged

feat(atc): enforce RFC 1123 TLD all-numeric rejection in IsHostName#365
davidkallesen merged 1 commit into
mainfrom
feature/support-RFC-1123-for-IsHostName

Conversation

@davidkallesen

Copy link
Copy Markdown
Collaborator

Summary

  • Apply RFC 1123 §2.1 rule: top-level label must not be all-numeric
  • Ensures IPv4 addresses (e.g. 192.168.0.27) are rejected by IsHostName
  • Fixes ambiguity between hostnames and numeric IPv4-like strings

Changes

✨ Features

  • Reject hostnames whose TLD is all-numeric per RFC 1123 §2.1
  • Single-label all-numeric values (e.g. "123") are now rejected

🐛 Fixes

  • IPv4 addresses no longer pass IsHostName (e.g. 192.168.0.27)
  • "example.123" and similar numeric-TLD strings now return false

📝 Documentation

  • Update IsHostName remarks to document the RFC 1123 TLD rule

🎨 Styling

  • Expand IsHostName from expression-body to block for logic clarity

@davidkallesen davidkallesen merged commit 5d45738 into main Jun 24, 2026
4 checks passed
@davidkallesen davidkallesen deleted the feature/support-RFC-1123-for-IsHostName branch June 24, 2026 13:35
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.

1 participant