Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Stop SetModTime losing metadata (eg X-Object-Manifest) - fixes #203

Nick Craig-Wood5bb76cc35cf0
diff --git a/swift/swift.go b/swift/swift.go
index eb6d0db2e..45b6ab347 100644
--- a/swift/swift.go
+++ b/swift/swift.go
@@ -517,6 +517,12 @@ func (o *Object) SetModTime(modTime time.Time) {
for k, v := range newHeaders {
(*o.headers)[k] = v
}
+ // Include any other metadata from request
+ for k, v := range *o.headers {
+ if strings.HasPrefix(k, "X-Object-") {
+ newHeaders[k] = v
+ }
+ }
err = o.fs.c.ObjectUpdate(o.fs.container, o.fs.root+o.remote, newHeaders)
if err != nil {
fs.Stats.Error()