fix(webdav): optimize HEAD request (close #5182)

This commit is contained in:
Andy Hsu
2023-09-06 16:32:51 +08:00
parent 623c7dcea5
commit d5b68a91d2
3 changed files with 12 additions and 6 deletions

View File

@ -51,6 +51,7 @@ func WebDAVAuth(c *gin.Context) {
username, password, ok := c.Request.BasicAuth()
if !ok {
bt := c.GetHeader("Authorization")
log.Debugf("[webdav auth] token: %s", bt)
if strings.HasPrefix(bt, "Bearer") {
bt = strings.TrimPrefix(bt, "Bearer ")
token := setting.GetStr(conf.Token)