We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7473cdf commit 730bf56Copy full SHA for 730bf56
server/middleware/operation.go
@@ -64,11 +64,12 @@ func OperationRecord() gin.HandlerFunc {
64
Body: string(body),
65
UserID: userId,
66
}
67
- // 存在某些未知错误 TODO
68
- //values := c.Request.Header.Values("content-type")
69
- //if len(values) >0 && strings.Contains(values[0], "boundary") {
70
- // record.Body = "file"
71
- //}
+ // 上传文件时候 中间件日志进行裁断操作
+ if strings.Index(c.GetHeader("Content-Type"), "multipart/form-data") > -1 {
+ if len(record.Body) > 512 {
+ record.Body = "File or Length out of limit"
+ }
72
73
writer := responseBodyWriter{
74
ResponseWriter: c.Writer,
75
body: &bytes.Buffer{},
0 commit comments