33 lines
735 B
Go
33 lines
735 B
Go
package api_security
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func BodyDump() gin.HandlerFunc {
|
|
return func(ctx *gin.Context) {
|
|
// fmt.Println("=========================== 1")
|
|
|
|
// fmt.Printf("%+v\n", ctx.Request.Header)
|
|
|
|
// data, e := ioutil.ReadAll(ctx.Request.Body)
|
|
// if e != nil {
|
|
// ctx.AbortWithStatusJSON(500, "protosign: read data failed")
|
|
// return
|
|
// }
|
|
|
|
// fmt.Println("=========================== 3")
|
|
// fmt.Println(hex.Dump(data))
|
|
|
|
// fmt.Println("=========================== 4")
|
|
// ctx.Request.Body = &signReader{
|
|
// *bytes.NewReader(data),
|
|
// ctx.Request.Body,
|
|
// }
|
|
// fmt.Println("=========================== 5")
|
|
// ctx.Next()
|
|
// fmt.Println("=========================== 6")
|
|
|
|
}
|
|
}
|