From 20bf93c86d7453d4ac1bdaf6bd2679f49d5951e9 Mon Sep 17 00:00:00 2001 From: X3STeNLiTE Date: Wed, 8 Apr 2020 22:53:54 +0700 Subject: fix hard-coded frontend max_upload_size validation (#20) --- app/app.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/app.go') 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) -- cgit v1.2.3