mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-05-01 09:40:30 -05:00
[server][webdav]Fix webdav
This commit is contained in:
@@ -423,8 +423,8 @@ func (h *Handler) handleUnlock(_ http.ResponseWriter, r *http.Request) (status i
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status int, err error) {
|
||||
reqPath, status, err := h.stripPrefix(r.URL.Path)
|
||||
func (h *Handler) handlePropfind(w http.ResponseWriter, request *http.Request) (status int, err error) {
|
||||
reqPath, status, err := h.stripPrefix(request.URL.Path)
|
||||
if err != nil {
|
||||
return status, err
|
||||
}
|
||||
@@ -436,13 +436,13 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status
|
||||
return http.StatusMethodNotAllowed, err
|
||||
}
|
||||
depth := infiniteDepth
|
||||
if hdr := r.Header.Get("Depth"); hdr != "" {
|
||||
if hdr := request.Header.Get("Depth"); hdr != "" {
|
||||
depth = parseDepth(hdr)
|
||||
if depth == invalidDepth {
|
||||
return http.StatusBadRequest, errInvalidDepth
|
||||
}
|
||||
}
|
||||
pf, status, err := readPropfind(r.Body)
|
||||
pf, status, err := readPropfind(request.Body)
|
||||
if err != nil {
|
||||
return status, err
|
||||
}
|
||||
@@ -469,7 +469,7 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
href := path.Join(reqPath, p)
|
||||
href := path.Join(request.URL.Path, p)
|
||||
if href != "/" && r.Dir() {
|
||||
href += "/"
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func (r Resource) Walk(depth int, fn func(serve.ResourceInfo, string) error) err
|
||||
}
|
||||
|
||||
for _, c := range children {
|
||||
if err := fn(c, suffix+r.Name()); err != nil {
|
||||
if err := fn(c, suffix+c.Name()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user