fix: 放宽验证Key的错误状态码为2XX (#107)
This commit is contained in:
@@ -115,8 +115,8 @@ func (ch *AnthropicChannel) ValidateKey(ctx context.Context, key string) (bool,
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user