mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 18:22:23 +08:00
Revert "Fix to use BindBodyBytesKey
for key"
This reverts commit 2c82901ceab6ae53730a3cfcd9839bee11a08f13.
This commit is contained in:
parent
2c82901cea
commit
edc5f44830
@ -31,7 +31,7 @@ const (
|
||||
MIMEPlain = binding.MIMEPlain
|
||||
MIMEPOSTForm = binding.MIMEPOSTForm
|
||||
MIMEMultipartPOSTForm = binding.MIMEMultipartPOSTForm
|
||||
BindBodyBytesKey = "github.com/gin-gonic/gin/bindBodyBytes"
|
||||
BodyBytesKey = "github.com/gin-gonic/gin/bodyBytes"
|
||||
)
|
||||
|
||||
const abortIndex int8 = math.MaxInt8 / 2
|
||||
@ -518,7 +518,7 @@ func (c *Context) ShouldBindBodyWith(
|
||||
obj interface{}, bb binding.BindingBody,
|
||||
) (err error) {
|
||||
var body []byte
|
||||
if cb, ok := c.Get(BindBodyBytesKey); ok {
|
||||
if cb, ok := c.Get(BodyBytesKey); ok {
|
||||
if cbb, ok := cb.([]byte); ok {
|
||||
body = cbb
|
||||
}
|
||||
@ -528,7 +528,7 @@ func (c *Context) ShouldBindBodyWith(
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Set(BindBodyBytesKey, body)
|
||||
c.Set(BodyBytesKey, body)
|
||||
}
|
||||
return bb.BindBody(body, obj)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user