summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/admin.go4
-rw-r--r--api/file.go4
-rw-r--r--api/license.go9
-rw-r--r--api/user.go4
4 files changed, 11 insertions, 10 deletions
diff --git a/api/admin.go b/api/admin.go
index 8f66f60c1..c2dfa37d0 100644
--- a/api/admin.go
+++ b/api/admin.go
@@ -437,13 +437,13 @@ func uploadBrandImage(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if r.ContentLength > model.MAX_FILE_SIZE {
+ if r.ContentLength > *utils.Cfg.FileSettings.MaxFileSize {
c.Err = model.NewLocAppError("uploadBrandImage", "api.admin.upload_brand_image.too_large.app_error", nil, "")
c.Err.StatusCode = http.StatusRequestEntityTooLarge
return
}
- if err := r.ParseMultipartForm(model.MAX_FILE_SIZE); err != nil {
+ if err := r.ParseMultipartForm(*utils.Cfg.FileSettings.MaxFileSize); err != nil {
c.Err = model.NewLocAppError("uploadBrandImage", "api.admin.upload_brand_image.parse.app_error", nil, "")
return
}
diff --git a/api/file.go b/api/file.go
index f4d1e0005..e29bb072a 100644
--- a/api/file.go
+++ b/api/file.go
@@ -77,13 +77,13 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if r.ContentLength > model.MAX_FILE_SIZE {
+ if r.ContentLength > *utils.Cfg.FileSettings.MaxFileSize {
c.Err = model.NewLocAppError("uploadFile", "api.file.upload_file.too_large.app_error", nil, "")
c.Err.StatusCode = http.StatusRequestEntityTooLarge
return
}
- err := r.ParseMultipartForm(model.MAX_FILE_SIZE)
+ err := r.ParseMultipartForm(*utils.Cfg.FileSettings.MaxFileSize)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
diff --git a/api/license.go b/api/license.go
index 1dbb2b281..f9ecce486 100644
--- a/api/license.go
+++ b/api/license.go
@@ -5,12 +5,13 @@ package api
import (
"bytes"
- l4g "github.com/alecthomas/log4go"
- "github.com/mattermost/platform/model"
- "github.com/mattermost/platform/utils"
"io"
"net/http"
"strings"
+
+ l4g "github.com/alecthomas/log4go"
+ "github.com/mattermost/platform/model"
+ "github.com/mattermost/platform/utils"
)
const (
@@ -48,7 +49,7 @@ func LoadLicense() {
func addLicense(c *Context, w http.ResponseWriter, r *http.Request) {
c.LogAudit("attempt")
- err := r.ParseMultipartForm(model.MAX_FILE_SIZE)
+ err := r.ParseMultipartForm(*utils.Cfg.FileSettings.MaxFileSize)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
diff --git a/api/user.go b/api/user.go
index ac99bd21b..628e978e9 100644
--- a/api/user.go
+++ b/api/user.go
@@ -1178,13 +1178,13 @@ func uploadProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if r.ContentLength > model.MAX_FILE_SIZE {
+ if r.ContentLength > *utils.Cfg.FileSettings.MaxFileSize {
c.Err = model.NewLocAppError("uploadProfileImage", "api.user.upload_profile_user.too_large.app_error", nil, "")
c.Err.StatusCode = http.StatusRequestEntityTooLarge
return
}
- if err := r.ParseMultipartForm(model.MAX_FILE_SIZE); err != nil {
+ if err := r.ParseMultipartForm(*utils.Cfg.FileSettings.MaxFileSize); err != nil {
c.Err = model.NewLocAppError("uploadProfileImage", "api.user.upload_profile_user.parse.app_error", nil, "")
return
}