优化结构
This commit is contained in:
@@ -73,7 +73,9 @@ func OperationAudit(runtime *config.Store, recorder *systemservice.AuditRecorder
|
||||
requestID, _ := c.Get("request_id")
|
||||
status := c.Writer.Status()
|
||||
responseBody := ""
|
||||
if value, ok := c.Get(ctxRespBufferKey); ok {
|
||||
if value, ok := c.Get(ctxRespTextKey); ok {
|
||||
responseBody = stringValue(value)
|
||||
} else if value, ok := c.Get(ctxRespBufferKey); ok {
|
||||
if body, bok := value.(*bytes.Buffer); bok {
|
||||
responseBody = redactJSON(body.Bytes(), c.Writer.Header().Get("Content-Type"), maxBytes)
|
||||
}
|
||||
@@ -91,10 +93,9 @@ func OperationAudit(runtime *config.Store, recorder *systemservice.AuditRecorder
|
||||
// second time.
|
||||
operationBody = stringValue(value)
|
||||
capturedBody = true
|
||||
} else {
|
||||
operationBody = operationRequestBody(requestBody, c.GetHeader("Content-Type"), maxBytes)
|
||||
}
|
||||
} else {
|
||||
}
|
||||
if !capturedBody {
|
||||
operationBody = operationRequestBody(requestBody, c.GetHeader("Content-Type"), maxBytes)
|
||||
}
|
||||
if !capturedBody && routecatalog.BodyPolicyFor(c.Request.Method, path) == routecatalog.BodyPolicyPaymentConfig {
|
||||
|
||||
Reference in New Issue
Block a user