优化结构
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user