Set correct ID in S3Store.GetInfo
This commit is contained in:
parent
bcea96b88e
commit
199487bdf6
|
@ -278,6 +278,11 @@ func (store S3Store) GetInfo(id string) (info tusd.FileInfo, err error) {
|
||||||
return info, err
|
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
|
// Get uploaded parts and their offset
|
||||||
listPtr, err := store.Service.ListParts(&s3.ListPartsInput{
|
listPtr, err := store.Service.ListParts(&s3.ListPartsInput{
|
||||||
Bucket: aws.String(store.Bucket),
|
Bucket: aws.String(store.Bucket),
|
||||||
|
|
|
@ -123,6 +123,7 @@ func TestGetInfo(t *testing.T) {
|
||||||
assert.Nil(err)
|
assert.Nil(err)
|
||||||
assert.Equal(int64(500), info.Size)
|
assert.Equal(int64(500), info.Size)
|
||||||
assert.Equal(int64(300), info.Offset)
|
assert.Equal(int64(300), info.Offset)
|
||||||
|
assert.Equal("uploadId+multipartId", info.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetInfoFinished(t *testing.T) {
|
func TestGetInfoFinished(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue