v0.0.220 add ginext.bufferBody

This commit is contained in:
2023-08-03 09:09:27 +02:00
parent 2f1b784dc2
commit 9136143f2f
6 changed files with 41 additions and 6 deletions

View 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)
}
}
}