From 57bcd376b4c88f5f71108cf2242aa4c6ff6ca4f4 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sat, 10 Sep 2022 19:27:34 +0800 Subject: [PATCH] fix(webdav): incorrect href if base_path isn't root (close #1629) --- server/webdav/webdav.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/webdav/webdav.go b/server/webdav/webdav.go index ce6acfad6a8..e4d2c173a9a 100644 --- a/server/webdav/webdav.go +++ b/server/webdav/webdav.go @@ -597,7 +597,7 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status if err != nil { return err } - href := path.Join(h.Prefix, reqPath) + href := path.Join(h.Prefix, strings.TrimPrefix(reqPath, user.BasePath)) if href != "/" && info.IsDir() { href += "/" }