Skip to content

fix(pit): allow numeric labels when registering names too - #120

Merged
ralyodio merged 1 commit into
mainfrom
fix/numeric-name-labels
Jul 31, 2026
Merged

fix(pit): allow numeric labels when registering names too#120
ralyodio merged 1 commit into
mainfrom
fix/numeric-name-labels

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Completes #119.

That PR correctly split normalizeLabel from normalizeTld — an all-numeric TLD is ambiguous against an IPv4 literal, an all-numeric label under one is not — and fixed resolution and exemptions. It missed the name-registration paths from #117, which were written before normalizeLabel existed.

What was still broken

123.eggs could be resolved and exempted, but not registered, retargeted or released:

location was
registerName normalizeTld(labelInput)null → "not a valid name"
ownedName (retarget/release) same
5 route responses label: null in the JSON
/pit confirmations null.eggs is yours.

to in the alias routes stays normalizeTld — that one genuinely is a TLD.

Verification

npm test164 pass, 0 fail. New coverage for the paths #119 didn't reach: register → retarget → resolve → release of a numeric label, plus an assertion that a numeric TLD is still refused.

🤖 Generated with Claude Code

#119 separated normalizeLabel from normalizeTld -- an all-numeric TLD is
ambiguous against an IPv4 literal, a label under one is not -- and fixed
resolution and exemptions. It missed the name-registration paths added in
#117, which were written before normalizeLabel existed.

registerName and ownedName still normalized the label with normalizeTld,
so 123.eggs resolved and could be exempted but could not be registered,
retargeted or released. The route handlers echoed labels back through
normalizeTld as well, which turned a numeric label into null in the JSON
response and into "null.eggs" in the /pit confirmation text.

`to` in the alias routes stays normalizeTld: that one really is a TLD.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 7642ae7 into main Jul 31, 2026
3 checks passed
@ralyodio
ralyodio deleted the fix/numeric-name-labels branch July 31, 2026 03:32
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