🎇 Pagination #257

This commit is contained in:
微凉
2022-01-04 21:21:27 +08:00
parent b60c7ecd9e
commit ef5cad1bf0
8 changed files with 98 additions and 43 deletions

View File

@ -49,11 +49,14 @@ func WebDAVAuth(c *gin.Context) {
c.Abort()
return
}
if conf.DavUsername == username && conf.DavPassword == password {
if conf.GetStr("WebDAV username") == username && conf.GetStr("WebDAV password") == password {
c.Next()
return
}
if (conf.VisitorDavUsername == username && conf.VisitorDavPassword == password) || (conf.VisitorDavUsername == "" && conf.VisitorDavPassword == "") {
if (conf.GetStr("Visitor WebDAV username") == username &&
conf.GetStr("Visitor WebDAV password") == password) ||
(conf.GetStr("Visitor WebDAV username") == "" &&
conf.GetStr("Visitor WebDAV password") == "") {
if !utils.IsContain([]string{"PUT", "DELETE", "PROPPATCH", "MKCOL", "COPY", "MOVE"}, c.Request.Method) {
c.Next()
return