change ShouldBind -> ShouldBindWith + binding.Form

This commit is contained in:
Дмитрий Саенко 2025-10-25 13:57:07 +03:00
parent 030adb5268
commit 0a6e02cf18

View file

@ -13,6 +13,7 @@ import (
"github.com/mhsanaei/3x-ui/v2/web/session"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
// InboundController handles HTTP requests related to Xray inbounds management.
@ -122,7 +123,8 @@ func (a *InboundController) addInbound(c *gin.Context) {
c.Request.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
inbound := &model.Inbound{}
err := c.ShouldBind(inbound)
err := c.ShouldBindWith(inbound, binding.Form)
// err := c.ShouldBind(inbound)
if err != nil {
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
return