mirror of
https://github.com/rclone/rclone.git
synced 2025-06-15 21:01:23 +08:00
azureblob: Add support for custom upload headers
This commit is contained in:

committed by
Nick Craig-Wood

parent
1392793334
commit
87fa9f8e46
@ -1685,6 +1685,26 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
}
|
||||
}
|
||||
|
||||
// Apply upload options (also allows one to overwrite content-type)
|
||||
for _, option := range options {
|
||||
key, value := option.Header()
|
||||
lowerKey := strings.ToLower(key)
|
||||
switch lowerKey {
|
||||
case "":
|
||||
// ignore
|
||||
case "cache-control":
|
||||
httpHeaders.CacheControl = value
|
||||
case "content-disposition":
|
||||
httpHeaders.ContentDisposition = value
|
||||
case "content-encoding":
|
||||
httpHeaders.ContentEncoding = value
|
||||
case "content-language":
|
||||
httpHeaders.ContentLanguage = value
|
||||
case "content-type":
|
||||
httpHeaders.ContentType = value
|
||||
}
|
||||
}
|
||||
|
||||
uploadParts := maxUploadParts
|
||||
if uploadParts < 1 {
|
||||
uploadParts = 1
|
||||
|
Reference in New Issue
Block a user