fleet-manager: register-admin link uses the first of multiple RP origins

Follow-up to comma-separated RP_ORIGIN support: the enrolment URL builder used
the raw origin string, which would embed the whole comma list. Take the first
origin for the link.
This commit is contained in:
Audiobuzz
2026-07-05 00:24:10 +00:00
parent 76446edd75
commit 2b3708c718
+7 -1
View File
@@ -150,7 +150,13 @@ func runRegisterAdmin(args []string) int {
fmt.Fprintf(os.Stderr, "mint: %v\n", err) fmt.Fprintf(os.Stderr, "mint: %v\n", err)
return 1 return 1
} }
base := strings.TrimRight(*origin, "/") // RP_ORIGIN may list several origins (comma-separated); the enrolment link
// uses the first one.
base := *origin
if i := strings.IndexByte(base, ','); i >= 0 {
base = base[:i]
}
base = strings.TrimRight(strings.TrimSpace(base), "/")
if base == "" { if base == "" {
base = "https://<admin-ui-origin>" base = "https://<admin-ui-origin>"
} }