mirror of
https://github.com/rclone/rclone.git
synced 2025-12-15 15:53:41 +00:00
build: use strings.CutPrefix introduced in go1.20
This commit is contained in:
@@ -6247,8 +6247,8 @@ func (o *Object) downloadFromURL(ctx context.Context, bucketPath string, options
|
|||||||
metaData := make(map[string]string)
|
metaData := make(map[string]string)
|
||||||
for key, value := range resp.Header {
|
for key, value := range resp.Header {
|
||||||
key = strings.ToLower(key)
|
key = strings.ToLower(key)
|
||||||
if strings.HasPrefix(key, "x-amz-meta-") {
|
if after, ok := strings.CutPrefix(key, "x-amz-meta-"); ok {
|
||||||
metaKey := strings.TrimPrefix(key, "x-amz-meta-")
|
metaKey := after
|
||||||
metaData[metaKey] = value[0]
|
metaData[metaKey] = value[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user