(scheme, host string, port int)
| 560 | } |
| 561 | |
| 562 | func buildOpenclawAllowedOrigin(scheme, host string, port int) (string, error) { |
| 563 | scheme = strings.TrimSpace(strings.ToLower(scheme)) |
| 564 | host = strings.TrimSpace(host) |
| 565 | if (scheme != "http" && scheme != "https") || host == "" || port <= 0 { |
| 566 | return "", fmt.Errorf("invalid openclaw allowed origin") |
| 567 | } |
| 568 | if strings.Contains(host, ":") && !strings.HasPrefix(host, "[") && strings.Count(host, ":") > 1 { |
| 569 | host = "[" + host + "]" |
| 570 | } |
| 571 | return normalizeAllowedOrigin(fmt.Sprintf("%s://%s:%d", scheme, host, port)) |
| 572 | } |
| 573 | |
| 574 | func checkAgentUpgradable(install model.AppInstall) bool { |
| 575 | if install.ID == 0 || install.Version == "" { |
no test coverage detected