Skip to content

Commit

Permalink
always set file length when initiating uploads
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Sep 18, 2023
1 parent f88be9e commit eac4bc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ func TempDir(name string) (string, error) {

// Upload can be used to initiate an upload and do the upload to a storage.FS in one step
func Upload(ctx context.Context, fs storage.FS, ref *provider.Reference, content []byte) error {
uploadIds, err := fs.InitiateUpload(ctx, ref, 0, map[string]string{})
size := len(content)
uploadIds, err := fs.InitiateUpload(ctx, ref, int64(size), map[string]string{})
if err != nil {
return err
}
Expand Down

0 comments on commit eac4bc5

Please sign in to comment.