fix: parse Coder authorities with Punycode (xn--) domain labels#930
Merged
fix: parse Coder authorities with Punycode (xn--) domain labels#930
Conversation
code-asher
approved these changes
May 5, 2026
parseRemoteAuthority splits the SSH host name on "--", which breaks any
domain containing a Punycode/IDNA label (xn--{encoded}). After the
existing split, walk the segments and merge each pair back together
while the prefix ends in ".xn" -- the cut landed inside an "xn--..."
label. This covers mid-domain, apex, and consecutive Punycode labels.
Refactors the parseRemoteAuthority describe block to it.each.
c0145dc to
7fbeb00
Compare
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.
Summary
parseRemoteAuthority(src/util.ts) splits the SSH host name on--, which breaks any domain containing a Punycode label (xn--{encoded}). After the existing split, the loop merges segment pairs back while the prefix ends in.xn(the cut landed inside anxn--...label). This covers mid-domain, apex (xn--p1ai), and consecutive Punycode labels.The
.xncheck is structural: Punycode's ACE prefix is IANA-reserved. It does not depend on Coder's username, workspace, or agent character rules.The
parseRemoteAuthoritydescribe block is refactored toit.each.Closes
Closes #929. Builds on #917, extending the same idea to the apex case.
Scope
A deployment on a non-Punycode
--label (e.g.foo--bar.example.com) is not handled. Registries block--outsidexn--at the TLD level, leaving operator-chosen subdomains as the only path. Supporting that case would require slug-shape validation of the tail, which couples this code to Coder's name rules.