webdav direct proxy

This commit is contained in:
Xhofe
2022-02-13 15:57:42 +08:00
parent 7bb237d0ef
commit 4371c470b3
8 changed files with 124 additions and 103 deletions

View File

@ -237,11 +237,14 @@ func (h *Handler) handleGetHeadPost(w http.ResponseWriter, r *http.Request, fs *
}
w.Header().Set("ETag", etag)
log.Debugf("url: %+v", r.URL)
link, err := fs.Link(r, reqPath)
link, err := fs.Link(w, r, reqPath)
log.Debugf("webdav link error: %s", err.Error())
if err != nil {
return http.StatusInternalServerError, err
}
http.Redirect(w, r, link, 302)
if link != "" {
http.Redirect(w, r, link, 302)
}
return 0, nil
}