fix(pit): allow numeric labels when registering names too - #120
Merged
Conversation
#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>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes #119.
That PR correctly split
normalizeLabelfromnormalizeTld— 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 beforenormalizeLabelexisted.What was still broken
123.eggscould be resolved and exempted, but not registered, retargeted or released:registerNamenormalizeTld(labelInput)→null→ "not a valid name"ownedName(retarget/release)label: nullin the JSON/pitconfirmationsnull.eggs is yours.toin the alias routes staysnormalizeTld— that one genuinely is a TLD.Verification
npm test→ 164 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