mirror of https://github.com/Xhofe/alist
feat: encode path of url (close #1351)
parent
0f853c86da
commit
06e15fc149
|
@ -55,7 +55,7 @@ func Proxy(c *gin.Context) {
|
|||
if ok {
|
||||
URL := fmt.Sprintf("%s%s?sign=%s",
|
||||
strings.Split(downProxyUrl, "\n")[0],
|
||||
utils.EncodePath(rawPath),
|
||||
utils.EncodePath(rawPath, true),
|
||||
sign.Sign(filename))
|
||||
c.Redirect(302, URL)
|
||||
return
|
||||
|
|
|
@ -248,7 +248,7 @@ func Link(c *gin.Context) {
|
|||
common.SuccessResp(c, model.Link{
|
||||
URL: fmt.Sprintf("%s/p%s?d&sign=%s",
|
||||
common.GetApiUrl(c.Request),
|
||||
utils.EncodePath(req.Path),
|
||||
utils.EncodePath(req.Path, true),
|
||||
sign.Sign(stdpath.Base(rawPath))),
|
||||
})
|
||||
return
|
||||
|
|
|
@ -250,7 +250,7 @@ func FsGet(c *gin.Context) {
|
|||
} else {
|
||||
rawURL = fmt.Sprintf("%s/p%s?sign=%s",
|
||||
common.GetApiUrl(c.Request),
|
||||
utils.EncodePath(req.Path),
|
||||
utils.EncodePath(req.Path, true),
|
||||
sign.Sign(obj.GetName()))
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -230,7 +230,7 @@ func (h *Handler) handleGetHeadPost(w http.ResponseWriter, r *http.Request) (sta
|
|||
} else if storage.Config().MustProxy() || storage.GetStorage().WebdavProxy() {
|
||||
u := fmt.Sprintf("%s/p%s?sign=%s",
|
||||
common.GetApiUrl(r),
|
||||
utils.EncodePath(reqPath),
|
||||
utils.EncodePath(reqPath, true),
|
||||
sign.Sign(path.Base(reqPath)))
|
||||
http.Redirect(w, r, u, 302)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue