Update upload.go

This commit is contained in:
ZizzyDizzyMC 2021-02-21 22:54:20 -05:00
parent 238b612860
commit 20c3d65e30
1 changed files with 0 additions and 27 deletions

View File

@ -59,15 +59,6 @@ func uploadPostHandler(c web.C, w http.ResponseWriter, r *http.Request) {
} }
upReq := UploadRequest{} 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) uploadHeaderProcess(r, &upReq)
contentType := r.Header.Get("Content-Type") 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) { func uploadPutHandler(c web.C, w http.ResponseWriter, r *http.Request) {
upReq := UploadRequest{} 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) uploadHeaderProcess(r, &upReq)
defer r.Body.Close() defer r.Body.Close()
@ -256,15 +238,6 @@ func uploadHeaderProcess(r *http.Request, upReq *UploadRequest) {
if r.Header.Get("Linx-Randomize") == "yes" { if r.Header.Get("Linx-Randomize") == "yes" {
upReq.randomBarename = true 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.deleteKey = r.Header.Get("Linx-Delete-Key")
upReq.accessKey = r.Header.Get(accessKeyHeaderName) upReq.accessKey = r.Header.Get(accessKeyHeaderName)
// Get seconds until expiry. Non-integer responses never expire. // Get seconds until expiry. Non-integer responses never expire.