fix(gin): update request body size check to allow zero limit

This commit is contained in:
CaIon
2026-01-05 18:55:24 +08:00
parent 3b05ac92e9
commit 04ff3df583

View File

@@ -40,7 +40,7 @@ func GetRequestBody(c *gin.Context) ([]byte, error) {
}
}
maxMB := constant.MaxRequestBodyMB
if maxMB < 0 {
if maxMB <= 0 {
// no limit
body, err := io.ReadAll(c.Request.Body)
_ = c.Request.Body.Close()