feat: local storage image thumbnail

This commit is contained in:
Noah Hsu
2022-08-11 20:32:17 +08:00
parent fda4db71bf
commit af884010d1
19 changed files with 178 additions and 61 deletions

View File

@ -228,7 +228,10 @@ func (h *Handler) handleGetHeadPost(w http.ResponseWriter, r *http.Request) (sta
return http.StatusInternalServerError, err
}
} else if storage.Config().MustProxy() || storage.GetStorage().WebdavProxy() {
u := fmt.Sprintf("%s/p%s?sign=%s", common.GetBaseUrl(r), reqPath, sign.Sign(path.Base(reqPath)))
u := fmt.Sprintf("%s/p%s?sign=%s",
common.GetApiUrl(r),
utils.EncodePath(reqPath),
sign.Sign(path.Base(reqPath)))
http.Redirect(w, r, u, 302)
} else {
link, _, err := fs.Link(ctx, reqPath, model.LinkArgs{IP: utils.ClientIP(r)})