From babd112665766d72bd3b5eb0fbe8e94517fee7a0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 14 Sep 2025 16:17:40 +0100 Subject: [PATCH] build: use strings.CutPrefix introduced in go1.20 --- backend/s3/s3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 3808b48a2..9fb2c51c8 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -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] } }