From 20c3d65e30f9c399c39462ba7381c436c4b9b517 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sun, 21 Feb 2021 22:54:20 -0500 Subject: [PATCH] Update upload.go --- upload.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/upload.go b/upload.go index 279e7fb..c2a181d 100644 --- a/upload.go +++ b/upload.go @@ -59,15 +59,6 @@ func uploadPostHandler(c web.C, w http.ResponseWriter, r *http.Request) { } upReq := UploadRequest{} - contentSize, err := strconv.ParseInt(r.Header.Get("Content-Length"), 10, 64) - if err != nil { - upReq.contentSize = 0 - log.Printf("error on content size conversion") - } else { - upReq.contentSize = contentSize - log.Printf("content size assigned") - log.Print(contentSize) - } uploadHeaderProcess(r, &upReq) contentType := r.Header.Get("Content-Type") @@ -137,15 +128,6 @@ func uploadPostHandler(c web.C, w http.ResponseWriter, r *http.Request) { func uploadPutHandler(c web.C, w http.ResponseWriter, r *http.Request) { upReq := UploadRequest{} - contentSize, err := strconv.ParseInt(r.Header.Get("Content-Length"), 10, 64) - if err != nil { - upReq.contentSize = 0 - log.Printf("error on content size conversion") - } else { - upReq.contentSize = contentSize - log.Printf("content size assigned") - log.Print(contentSize) - } uploadHeaderProcess(r, &upReq) defer r.Body.Close() @@ -256,15 +238,6 @@ func uploadHeaderProcess(r *http.Request, upReq *UploadRequest) { if r.Header.Get("Linx-Randomize") == "yes" { upReq.randomBarename = true } - contentSize, err := strconv.ParseInt(r.Header.Get("Content-Length"), 10, 64) - if err != nil { - upReq.contentSize = 0 - log.Printf("error on content size conversion") - } else { - upReq.contentSize = contentSize - log.Printf("content size assigned") - log.Print(upReq.contentSize) - } upReq.deleteKey = r.Header.Get("Linx-Delete-Key") upReq.accessKey = r.Header.Get(accessKeyHeaderName) // Get seconds until expiry. Non-integer responses never expire.