fix: Changed exceeding range error for the source object in UploadPartCopy action

This commit is contained in:
jonaustin09
2024-06-20 14:12:03 -04:00
parent be098d2031
commit fe19bfaed9
3 changed files with 12 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ import (
"crypto/md5"
"encoding/hex"
"fmt"
"net/http"
"strconv"
"strings"
"time"
@@ -98,6 +99,14 @@ func ParseRange(size int64, acceptRange string) (int64, int64, error) {
return startOffset, endOffset - startOffset + 1, nil
}
func CreateExceedingRangeErr(objSize int64) s3err.APIError {
return s3err.APIError{
Code: "InvalidArgument",
Description: fmt.Sprintf("Range specified is not valid for source object of size: %d", objSize),
HTTPStatusCode: http.StatusBadRequest,
}
}
func GetMultipartMD5(parts []types.CompletedPart) string {
var partsEtagBytes []byte
for _, part := range parts {