Modify: change raw object ID to Hash ID in file service

This commit is contained in:
HFO4
2020-02-10 13:10:59 +08:00
parent f235ad1def
commit 9be1b4366f
16 changed files with 287 additions and 121 deletions

View File

@@ -231,7 +231,13 @@ func (h *Handler) handleGetHeadPost(w http.ResponseWriter, r *http.Request, fs *
ctx := r.Context()
rs, err := fs.Preview(ctx, reqPath, false)
exist, file := fs.IsFileExist(reqPath)
if !exist {
return http.StatusNotFound, nil
}
fs.SetTargetFile(&[]model.File{*file})
rs, err := fs.Preview(ctx, 0, false)
if err != nil {
if err == filesystem.ErrObjectNotExist {
return http.StatusNotFound, err