fix: 放宽验证Key的错误状态码为2XX (#107)

This commit is contained in:
tbphp
2025-08-03 12:32:59 +08:00
committed by GitHub
parent 2be2ea697e
commit 7e3797d2ad
3 changed files with 6 additions and 6 deletions

View File

@@ -113,8 +113,8 @@ func (ch *OpenAIChannel) ValidateKey(ctx context.Context, key string) (bool, err
}
defer resp.Body.Close()
// A 200 OK status code indicates the key is valid and can make requests.
if resp.StatusCode == http.StatusOK {
// Any 2xx status code indicates the key is valid.
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
return true, nil
}