中间件不再记录二进制文件类型日志
This commit is contained in:
parent
7af2dffb7a
commit
7475bc56c9
|
|
@ -11,7 +11,6 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -46,10 +45,11 @@ func OperationRecord() gin.HandlerFunc {
|
||||||
Body: string(body),
|
Body: string(body),
|
||||||
UserID: userId,
|
UserID: userId,
|
||||||
}
|
}
|
||||||
values := c.Request.Header.Values("content-type")
|
// 存在某些未知错误 TODO
|
||||||
if len(values) >0 && strings.Contains(values[0], "boundary") {
|
//values := c.Request.Header.Values("content-type")
|
||||||
record.Body = "file"
|
//if len(values) >0 && strings.Contains(values[0], "boundary") {
|
||||||
}
|
// record.Body = "file"
|
||||||
|
//}
|
||||||
writer := responseBodyWriter{
|
writer := responseBodyWriter{
|
||||||
ResponseWriter: c.Writer,
|
ResponseWriter: c.Writer,
|
||||||
body: &bytes.Buffer{},
|
body: &bytes.Buffer{},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue