Browse Source

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

CaIon 2 months ago
parent
commit
ad61c0f89e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      common/gin.go

+ 1 - 1
common/gin.go

@@ -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()