优化结构

This commit is contained in:
Yvan
2026-08-28 15:37:40 +08:00
parent a4ed3a02df
commit 9b1daaf3f6
17 changed files with 100 additions and 64 deletions
+3
View File
@@ -15,6 +15,7 @@ const (
ctxReqBodyKey = "kra_req_body"
ctxRespBufferKey = "kra_resp_buffer"
ctxRespTruncatedKey = "kra_resp_truncated"
ctxRespTextKey = "kra_resp_text"
)
type captureWriter struct {
@@ -37,6 +38,8 @@ func (w *captureWriter) Write(data []byte) (int, error) {
} else {
_, _ = w.body.Write(data)
}
} else if len(data) > 0 {
w.truncated = true
}
return w.ResponseWriter.Write(data)
}