Skip to content

Commit f023652

Browse files
fix(115): error getting file sha1 when upload (#482)
1 parent 6a3b8fa commit f023652

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/115/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (d *Pan115) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
186186
preHash = strings.ToUpper(preHash)
187187
fullHash := stream.GetHash().GetHash(utils.SHA1)
188188
if len(fullHash) != utils.SHA1.Width {
189-
_, fullHash, err = streamPkg.CacheFullInTempFileAndHash(stream, utils.SHA256)
189+
_, fullHash, err = streamPkg.CacheFullInTempFileAndHash(stream, utils.SHA1)
190190
if err != nil {
191191
return nil, err
192192
}

drivers/115_open/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (d *Open115) Put(ctx context.Context, dstDir model.Obj, file model.FileStre
222222
}
223223
sha1 := file.GetHash().GetHash(utils.SHA1)
224224
if len(sha1) != utils.SHA1.Width {
225-
_, sha1, err = stream.CacheFullInTempFileAndHash(file, utils.SHA256)
225+
_, sha1, err = stream.CacheFullInTempFileAndHash(file, utils.SHA1)
226226
if err != nil {
227227
return err
228228
}

0 commit comments

Comments
 (0)