Skip to content

Commit

Permalink
Set correct ID in S3Store.GetInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Mar 26, 2016
1 parent bcea96b commit 199487b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions s3store/s3store.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ func (store S3Store) GetInfo(id string) (info tusd.FileInfo, err error) {
return info, err
}

// The JSON object stored on S3 does not contain the proper upload ID because
// the ID has constructed after the storing happened. Therefore we set it
// manually.
info.ID = id

// Get uploaded parts and their offset
listPtr, err := store.Service.ListParts(&s3.ListPartsInput{
Bucket: aws.String(store.Bucket),
Expand Down
1 change: 1 addition & 0 deletions s3store/s3store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func TestGetInfo(t *testing.T) {
assert.Nil(err)
assert.Equal(int64(500), info.Size)
assert.Equal(int64(300), info.Offset)
assert.Equal("uploadId+multipartId", info.ID)
}

func TestGetInfoFinished(t *testing.T) {
Expand Down

0 comments on commit 199487b

Please sign in to comment.