From b8f4b55f0536078127441a9adfef69e2aee37575 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sun, 21 Feb 2021 20:40:10 -0500 Subject: [PATCH] Content-Length rejection if specified larger than allowed size. --- upload.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/upload.go b/upload.go index b5e5a83..d91e182 100644 --- a/upload.go +++ b/upload.go @@ -228,6 +228,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 r.Header.Get("Content-Length") > Config.maxSize { + upReq.size = r.Header.Get("Content-Length") + } + } if r.Header.Get("Linx-Randomize") == "yes" { upReq.randomBarename = true }