aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weed/s3api/s3api_object_handlers_multipart.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/weed/s3api/s3api_object_handlers_multipart.go b/weed/s3api/s3api_object_handlers_multipart.go
index 8b08bda9e..871e34535 100644
--- a/weed/s3api/s3api_object_handlers_multipart.go
+++ b/weed/s3api/s3api_object_handlers_multipart.go
@@ -331,9 +331,8 @@ func (s3a *S3ApiServer) genPartUploadUrl(bucket, uploadID string, partID int) st
// Generate uploadID hash string from object
func (s3a *S3ApiServer) generateUploadID(object string) string {
- if strings.HasPrefix(object, "/") {
- object = object[1:]
- }
+
+ object = strings.TrimPrefix(object, "/")
h := sha1.New()
h.Write([]byte(object))
return fmt.Sprintf("%x", h.Sum(nil))