From dfe00146091b837cd868328e9442068c7aed99b7 Mon Sep 17 00:00:00 2001 From: yusing Date: Mon, 18 Aug 2025 20:46:59 +0800 Subject: [PATCH] fix(route): handle subdomain removal in URL construction for homepage items --- internal/route/routes/query.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/route/routes/query.go b/internal/route/routes/query.go index c0e7e834..dbfb7ea2 100644 --- a/internal/route/routes/query.go +++ b/internal/route/routes/query.go @@ -122,6 +122,9 @@ func HomepageItems(proto, hostname, categoryFilter, providerFilter string) homep // append hostname if provided and only if alias is not FQDN if hostname != "" && item.URL == "" { if !strings.Contains(item.Alias, ".") { + if strings.Count(hostname, ".") > 1 { + _, hostname, _ = strings.Cut(hostname, ".") // remove the subdomain + } item.URL = fmt.Sprintf("%s://%s.%s", proto, item.Alias, hostname) } }