1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

build: use strings.CutPrefix introduced in go1.20

This commit is contained in:
Nick Craig-Wood
2025-09-14 16:17:40 +01:00
parent 71b9b4ad7a
commit babd112665

View File

@@ -6247,8 +6247,8 @@ func (o *Object) downloadFromURL(ctx context.Context, bucketPath string, options
metaData := make(map[string]string)
for key, value := range resp.Header {
key = strings.ToLower(key)
if strings.HasPrefix(key, "x-amz-meta-") {
metaKey := strings.TrimPrefix(key, "x-amz-meta-")
if after, ok := strings.CutPrefix(key, "x-amz-meta-"); ok {
metaKey := after
metaData[metaKey] = value[0]
}
}