mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 22:02:15 +08:00
s3: add --s3-no-system-metadata to suppress read and write of system metadata
See: https://forum.rclone.org/t/problems-with-content-disposition-and-backblaze-b2-using-s3/33292/
This commit is contained in:
parent
bb3272e837
commit
fce22c0065
|
@ -2164,6 +2164,11 @@ can't check the size and hash but the file contents will be decompressed.
|
||||||
`,
|
`,
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
|
}, {
|
||||||
|
Name: "no_system_metadata",
|
||||||
|
Help: `Suppress setting and reading of system metadata`,
|
||||||
|
Advanced: true,
|
||||||
|
Default: false,
|
||||||
},
|
},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -2290,6 +2295,7 @@ type Options struct {
|
||||||
Versions bool `config:"versions"`
|
Versions bool `config:"versions"`
|
||||||
VersionAt fs.Time `config:"version_at"`
|
VersionAt fs.Time `config:"version_at"`
|
||||||
Decompress bool `config:"decompress"`
|
Decompress bool `config:"decompress"`
|
||||||
|
NoSystemMetadata bool `config:"no_system_metadata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fs represents a remote s3 server
|
// Fs represents a remote s3 server
|
||||||
|
@ -5227,6 +5233,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||||
for k, v := range meta {
|
for k, v := range meta {
|
||||||
pv := aws.String(v)
|
pv := aws.String(v)
|
||||||
k = strings.ToLower(k)
|
k = strings.ToLower(k)
|
||||||
|
if o.fs.opt.NoSystemMetadata {
|
||||||
|
req.Metadata[k] = pv
|
||||||
|
continue
|
||||||
|
}
|
||||||
switch k {
|
switch k {
|
||||||
case "cache-control":
|
case "cache-control":
|
||||||
req.CacheControl = pv
|
req.CacheControl = pv
|
||||||
|
@ -5505,6 +5515,9 @@ func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error)
|
||||||
|
|
||||||
// Set system metadata
|
// Set system metadata
|
||||||
setMetadata := func(k string, v *string) {
|
setMetadata := func(k string, v *string) {
|
||||||
|
if o.fs.opt.NoSystemMetadata {
|
||||||
|
return
|
||||||
|
}
|
||||||
if v == nil || *v == "" {
|
if v == nil || *v == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user