mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 04:10:51 +08:00
fix(logging): update response aggregation logic to include all attempts
This commit is contained in:
@@ -157,7 +157,7 @@ func appendAPIResponseChunk(ctx context.Context, cfg *config.Config, chunk []byt
|
|||||||
if ginCtx == nil {
|
if ginCtx == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, attempt := ensureAttempt(ginCtx)
|
attempts, attempt := ensureAttempt(ginCtx)
|
||||||
ensureResponseIntro(attempt)
|
ensureResponseIntro(attempt)
|
||||||
|
|
||||||
if !attempt.headersWritten {
|
if !attempt.headersWritten {
|
||||||
@@ -175,6 +175,8 @@ func appendAPIResponseChunk(ctx context.Context, cfg *config.Config, chunk []byt
|
|||||||
}
|
}
|
||||||
attempt.response.WriteString(string(data))
|
attempt.response.WriteString(string(data))
|
||||||
attempt.bodyHasContent = true
|
attempt.bodyHasContent = true
|
||||||
|
|
||||||
|
updateAggregatedResponse(ginCtx, attempts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ginContextFrom(ctx context.Context) *gin.Context {
|
func ginContextFrom(ctx context.Context) *gin.Context {
|
||||||
|
|||||||
Reference in New Issue
Block a user