From 357f1b18839bd0087aff0ed3d136bcf9e7964b2f Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sun, 21 Feb 2021 20:56:12 -0500 Subject: [PATCH] Update upload.go --- upload.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/upload.go b/upload.go index 001b933..9d6a0ae 100644 --- a/upload.go +++ b/upload.go @@ -229,8 +229,11 @@ func uploadRemote(c web.C, w http.ResponseWriter, r *http.Request) { func uploadHeaderProcess(r *http.Request, upReq *UploadRequest) { if len(r.Header.Get("Content-Length")) > 0 { - if strconv.ParseInt(r.Header.Get("Content-Length"), 10, 64) > Config.maxSize { - upReq.size = strconv.ParseInt(r.Header.Get("Content-Length"), 10, 64) + i, err := strconv.ParseInt(r.Header.Get("Content-Length"), 10, 64) + if err = nil { + if i > Config.maxSize { + upReq.size = i + } } } if r.Header.Get("Linx-Randomize") == "yes" {