|
@@ -16,9 +16,9 @@ import (
|
|
|
func Recover() gin.HandlerFunc {
|
|
|
return func(c *gin.Context) {
|
|
|
contentType := c.ContentType()
|
|
|
- // 为 multipart forms 设置较低的内存限制(50M) (默认是 32 MiB)
|
|
|
+ // 为 multipart forms 设置较低的内存限制(100M) (默认是 32 MiB)
|
|
|
if contentType == "multipart/form-data" {
|
|
|
- err := c.Request.ParseMultipartForm(10 << 20)
|
|
|
+ err := c.Request.ParseMultipartForm(100 << 20)
|
|
|
if err != nil {
|
|
|
resp.Custom(http.StatusRequestEntityTooLarge, "上传文件太大,err:"+err.Error(), c)
|
|
|
c.Abort()
|