🎇 md5 and filename

This commit is contained in:
微凉
2021-12-02 18:57:29 +08:00
parent 1d7d37e642
commit d81ec0637d
4 changed files with 17 additions and 9 deletions

View File

@ -18,7 +18,7 @@ func Down(c *gin.Context) {
rawPath = utils.ParsePath(rawPath)
log.Debugf("down: %s", rawPath)
pw := c.Query("pw")
if !CheckDownLink(utils.Dir(rawPath), pw) {
if !CheckDownLink(utils.Dir(rawPath), pw, utils.Base(rawPath)) {
ErrorResp(c, fmt.Errorf("wrong password"), 401)
return
}
@ -50,7 +50,7 @@ func Proxy(c *gin.Context) {
rawPath = utils.ParsePath(rawPath)
log.Debugf("proxy: %s", rawPath)
pw := c.Query("pw")
if !CheckDownLink(utils.Dir(rawPath), pw) {
if !CheckDownLink(utils.Dir(rawPath), pw, utils.Base(rawPath)) {
ErrorResp(c, fmt.Errorf("wrong password"), 401)
return
}