summaryrefslogtreecommitdiff
path: root/app/app.go
diff options
context:
space:
mode:
authorX3STeNLiTE <xestenlite@gmail.com>2020-04-08 22:53:54 +0700
committerGitHub <noreply@github.com>2020-04-09 01:53:54 +1000
commit20bf93c86d7453d4ac1bdaf6bd2679f49d5951e9 (patch)
tree083c965025efc01bc864b69bc3f47c0828daf85a /app/app.go
parentcb8d61538dac417f3534558e864e9982616c2010 (diff)
fix hard-coded frontend max_upload_size validation (#20)
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/app.go b/app/app.go
index 7e492b3..6fa4728 100644
--- a/app/app.go
+++ b/app/app.go
@@ -204,7 +204,9 @@ func (a *App) indexHandler(w http.ResponseWriter, r *http.Request) {
// HTTP handler for /upload
func (a *App) uploadHandler(w http.ResponseWriter, r *http.Request) {
if r.Method == "GET" {
- ctx := &struct{}{}
+ ctx := map[string]interface{}{
+ "MAX_UPLOAD_SIZE": a.Config.Server.MaxUploadSize,
+ }
a.render("upload", w, ctx)
} else if r.Method == "POST" {
r.ParseMultipartForm(a.Config.Server.MaxUploadSize)