Skip to content

Commit 13b56ff

Browse files
authored
Merge pull request #109 from agin719/cos-v4-dev
update
2 parents d58178d + 0c00da5 commit 13b56ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

object.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,13 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
771771
Key: name,
772772
ETag: rsp.Header.Get("ETag"),
773773
}
774+
if rsp != nil && opt.EnableVerification {
775+
scoscrc := rsp.Header.Get("x-cos-hash-crc64ecma")
776+
icoscrc, _ := strconv.ParseUint(scoscrc, 10, 64)
777+
if icoscrc != localcrc {
778+
return result, rsp, fmt.Errorf("verification failed, want:%v, return:%v", localcrc, icoscrc)
779+
}
780+
}
774781
return result, rsp, nil
775782
}
776783

0 commit comments

Comments
 (0)