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:
@@ -150,7 +150,13 @@ func runRegisterAdmin(args []string) int {
|
||||
fmt.Fprintf(os.Stderr, "mint: %v\n", err)
|
||||
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 == "" {
|
||||
base = "https://<admin-ui-origin>"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user