From 2273cc9b60054937987e57db044e0d4fdb8b25cb Mon Sep 17 00:00:00 2001 From: Derek Weitzel Date: Tue, 10 Oct 2023 13:25:11 -0500 Subject: [PATCH] Remove content length from upload to enable chunked Removing the content length from a put changes the upload style from full file upload to a chunked encoded upload. A full file upload causes go to read in the entire file in memory while uploading, chunked does not. **NOTE** chunked uploads only work after xrootd has merged and put into production xrootd/xrootd#2102 Corresponds to https://github.com/htcondor/osdf-client/pull/88 --- client/handle_http.go | 1 - 1 file changed, 1 deletion(-) diff --git a/client/handle_http.go b/client/handle_http.go index f0dedf283..1c3f46dae 100644 --- a/client/handle_http.go +++ b/client/handle_http.go @@ -727,7 +727,6 @@ func UploadFile(src string, dest *url.URL, token string, namespace namespaces.Na log.Errorln("Error creating request:", err) return 0, err } - request.ContentLength = fileInfo.Size() // Set the authorization header request.Header.Set("Authorization", "Bearer "+token) var lastKnownWritten int64