From 827a565a8a1055b73108e514708d33a2babef4d8 Mon Sep 17 00:00:00 2001 From: SliverHorn <503551462@qq.com> Date: Fri, 25 Sep 2020 16:37:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=AE=B0=E5=BD=95body=E5=A4=AA=E5=A4=A7=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/middleware/operation.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/middleware/operation.go b/server/middleware/operation.go index 72a7fb79..125542c1 100644 --- a/server/middleware/operation.go +++ b/server/middleware/operation.go @@ -11,6 +11,7 @@ import ( "io/ioutil" "net/http" "strconv" + "strings" "time" ) @@ -45,6 +46,10 @@ func OperationRecord() gin.HandlerFunc { Body: string(body), UserID: userId, } + values := c.Request.Header.Values("content-type") + if strings.Contains(values[0], "boundary"){ + record.Body = "file" + } writer := responseBodyWriter{ ResponseWriter: c.Writer, body: &bytes.Buffer{},