diff --git a/weed/s3api/s3api_streaming_copy.go b/weed/s3api/s3api_streaming_copy.go index 1a86bdc48..300b1886a 100644 --- a/weed/s3api/s3api_streaming_copy.go +++ b/weed/s3api/s3api_streaming_copy.go @@ -512,17 +512,17 @@ func (scm *StreamingCopyManager) createChunkFromData(data []byte, offset int64, if len(baseIV) > 0 { chunkIV, _ := calculateIVWithOffset(baseIV, offset) // Create chunk key with the chunk-specific IV - chunkSSEKey := &SSES3Key{ - Key: sseKey.Key, - KeyID: sseKey.KeyID, - Algorithm: sseKey.Algorithm, - IV: chunkIV, - } - chunkMetadata, serErr := SerializeSSES3Metadata(chunkSSEKey) - if serErr != nil { - return nil, fmt.Errorf("failed to serialize chunk SSE-S3 metadata: %w", serErr) - } - chunk.SseMetadata = chunkMetadata + chunkSSEKey := &SSES3Key{ + Key: sseKey.Key, + KeyID: sseKey.KeyID, + Algorithm: sseKey.Algorithm, + IV: chunkIV, + } + chunkMetadata, serErr := SerializeSSES3Metadata(chunkSSEKey) + if serErr != nil { + return nil, fmt.Errorf("failed to serialize chunk SSE-S3 metadata: %w", serErr) + } + chunk.SseMetadata = chunkMetadata } } }