Set correct ID in S3Store.GetInfo

This commit is contained in:
Marius 2016-03-26 18:23:37 +01:00
parent bcea96b88e
commit 199487bdf6
2 changed files with 6 additions and 0 deletions

View File

@ -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),

View File

@ -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) {