fix(moonshot): resolve 401 Unauthorized errors by trimming API keys and improving request compatibility
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Build (push) Has been cancelled

This commit is contained in:
2026-03-26 17:09:27 +00:00
parent 5be2f6f7aa
commit 9375448087
3 changed files with 24 additions and 5 deletions

View File

@@ -203,5 +203,5 @@ func (c *Config) GetAPIKey(provider string) (string, error) {
if val == "" {
return "", fmt.Errorf("environment variable %s not set for %s", envVar, provider)
}
return val, nil
return strings.TrimSpace(val), nil
}