Preserve authentication cancellation at the response limit
This commit is contained in:
@@ -59,6 +59,9 @@ func (c *OpenAICompatibleClient) ProbeOpenRouterKey(ctx context.Context, endpoin
|
||||
return result, nil
|
||||
}
|
||||
contents, err := io.ReadAll(io.LimitReader(response.Body, maxAuthenticationResponseBytes+1))
|
||||
if err != nil && ctx.Err() != nil {
|
||||
return result, ctx.Err()
|
||||
}
|
||||
if len(contents) > maxAuthenticationResponseBytes {
|
||||
result.Overflow = true
|
||||
return result, nil
|
||||
|
||||
Reference in New Issue
Block a user