v0.0.220 add ginext.bufferBody
This commit is contained in:
14
ginext/commonMiddlewares.go
Normal file
14
ginext/commonMiddlewares.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package ginext
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/dataext"
|
||||
)
|
||||
|
||||
func BodyBuffer() gin.HandlerFunc {
|
||||
return func(g *gin.Context) {
|
||||
if g.Request.Body != nil {
|
||||
g.Request.Body = dataext.NewBufferedReadCloser(g.Request.Body)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user