Skip to content

Commit

Permalink
fix(alias): unable to locate file in copy link
Browse files Browse the repository at this point in the history
  • Loading branch information
EtherealAO committed Dec 24, 2023
1 parent 6b7e1d3 commit 2f4e5bf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/handles/fsread.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func FsGet(c *gin.Context) {
}
parentMeta, _ := op.GetNearestMeta(parentPath)
thumb, _ := model.GetThumb(obj)
common.SuccessResp(c, FsGetResp{
fsresp := FsGetResp{
ObjResp: ObjResp{
Name: obj.GetName(),
Size: obj.GetSize(),
Expand All @@ -332,7 +332,6 @@ func FsGet(c *gin.Context) {
Created: obj.CreateTime(),
HashInfoStr: obj.GetHash().String(),
HashInfo: obj.GetHash().Export(),
Sign: common.Sign(obj, parentPath, isEncrypt(meta, reqPath)),
Type: utils.GetFileType(obj.GetName()),
Thumb: thumb,
},
Expand All @@ -341,7 +340,14 @@ func FsGet(c *gin.Context) {
Header: getHeader(meta, reqPath),
Provider: provider,
Related: toObjsResp(related, parentPath, isEncrypt(parentMeta, parentPath)),
})
}
if provider == "Alias" {
fsresp.Name = stdpath.Base(reqPath)
fsresp.Sign = sign.Sign(reqPath)
} else {
fsresp.Sign = common.Sign(obj, parentPath, isEncrypt(meta, reqPath))
}
common.SuccessResp(c, fsresp)
}

func filterRelated(objs []model.Obj, obj model.Obj) []model.Obj {
Expand Down

0 comments on commit 2f4e5bf

Please sign in to comment.