mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
remove file and form from log
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@@ -75,8 +76,14 @@ func WebLogger() gin.HandlerFunc {
|
|||||||
c.Next()
|
c.Next()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
body := ""
|
||||||
|
//save body if not form or file
|
||||||
|
if !strings.HasPrefix(c.Request.Header.Get("Content-Type"), "multipart/form-data") {
|
||||||
body, _ := ioutil.ReadAll(c.Request.Body)
|
body, _ := ioutil.ReadAll(c.Request.Body)
|
||||||
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
|
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
|
||||||
|
} else {
|
||||||
|
body = "body hidden, too large"
|
||||||
|
}
|
||||||
c.Next()
|
c.Next()
|
||||||
|
|
||||||
statusCode := c.Writer.Status()
|
statusCode := c.Writer.Status()
|
||||||
|
|||||||
Reference in New Issue
Block a user