summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaster4385 <venkatesh@tablaster.dev>2024-07-23 01:14:08 +0530
committerBlaster4385 <venkatesh@tablaster.dev>2024-07-25 17:15:46 +0530
commit2baf3c61092abb3157773fdcd52eeb7bf46e6b91 (patch)
tree45c1ad3defa1f656f28c15d176c63daf8065b3ed
parent26cf8aa1cbb894ce91e866da1227ea42a92fdfab (diff)
fix: enforce upload limit
- also increase file size limit
-rw-r--r--server/main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/main.go b/server/main.go
index 9a1efbd..cd2e445 100644
--- a/server/main.go
+++ b/server/main.go
@@ -20,7 +20,7 @@ import (
)
const (
- maxUploadSize = 10 * 1024 * 1024 // 10 MB
+ maxUploadSize = 3 * 1024 * 1024 * 1024 // 3 GB
keySize = 32
nonceSize = 12
)
@@ -31,6 +31,7 @@ var db *sql.DB
var dist embed.FS
func registerHandlers(e *echo.Echo) {
+ e.Use(middleware.BodyLimit(fmt.Sprintf("%dM", maxUploadSize/(1024*1024))))
e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
Root: "dist",
Index: "upload.html",