Skip to content

Commit

Permalink
Remove content length from put to enable chunked
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
djw8605 committed Oct 10, 2023
1 parent 766e7b4 commit 4646bc2
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion handle_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,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
Expand Down

0 comments on commit 4646bc2

Please sign in to comment.