google cloud storage: Update metadata on Put since we get it back

This commit is contained in:
Nick Craig-Wood 2014-07-16 12:12:36 +01:00
parent 680283d69f
commit cad9479a00

View File

@ -554,8 +554,9 @@ func (o *FsObjectStorage) Update(in io.Reader, modTime time.Time, size int64) er
Updated: modTime.Format(RFC3339Out), // Doesn't get set Updated: modTime.Format(RFC3339Out), // Doesn't get set
Metadata: metadataFromModTime(modTime), Metadata: metadataFromModTime(modTime),
} }
_, err := o.storage.svc.Objects.Insert(o.storage.bucket, &object).Media(in).Name(object.Name).PredefinedAcl(o.storage.objectAcl).Do() newObject, err := o.storage.svc.Objects.Insert(o.storage.bucket, &object).Media(in).Name(object.Name).PredefinedAcl(o.storage.objectAcl).Do()
// FIXME read back the MD5sum out of the returned object and check it? // Set the metadata for the new object while we have it
o.setMetaData(newObject)
return err return err
} }