mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 日志拦截解压方式判断修改 (#1260)
This commit is contained in:
parent
9f4e5050dd
commit
4e786fee31
@ -130,6 +130,8 @@ func OperationLog() gin.HandlerFunc {
|
|||||||
|
|
||||||
c.Next()
|
c.Next()
|
||||||
|
|
||||||
|
datas := writer.body.Bytes()
|
||||||
|
if c.Request.Header.Get("Content-Encoding") == "gzip" {
|
||||||
buf := bytes.NewReader(writer.body.Bytes())
|
buf := bytes.NewReader(writer.body.Bytes())
|
||||||
reader, err := gzip.NewReader(buf)
|
reader, err := gzip.NewReader(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -144,7 +146,8 @@ func OperationLog() gin.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer reader.Close()
|
defer reader.Close()
|
||||||
datas, _ := io.ReadAll(reader)
|
datas, _ = io.ReadAll(reader)
|
||||||
|
}
|
||||||
var res response
|
var res response
|
||||||
_ = json.Unmarshal(datas, &res)
|
_ = json.Unmarshal(datas, &res)
|
||||||
if res.Code == 200 {
|
if res.Code == 200 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user