Fix subdomain length limit to match AT Protocol spec

AT Protocol allows 63 characters per label, not 18. The previous
limit was incorrectly truncating category names like
"science-and-environment" and "entertainment-and-arts".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-01-28 20:53:42 -05:00
parent 27c3fa1a3c
commit 39714858e5
+2 -2
View File
@@ -550,12 +550,12 @@ func stripHTML(s string) string {
// DeriveHandleFromFeed generates an AT Protocol handle from a feed URL
// Format: {domain}-{category}.1440.news
// The PDS limits subdomains to 18 characters, so we prioritize meaningful parts
// AT Protocol allows up to 63 characters per label
// Examples:
// feeds.bbci.co.uk/news/technology/rss.xml → bbc-technology.1440.news
// news.ycombinator.com/rss → ycombinator.1440.news
func DeriveHandleFromFeed(feedURL string) string {
const maxSubdomainLen = 18
const maxSubdomainLen = 63
// Ensure we have a scheme for parsing
if !strings.Contains(feedURL, "://") {