fix(http): canonicalize paths before checking access rules (#6045)

This commit is contained in:
Henrique Dias authored and GitHub committed 2026-07-26 10:00:18 +02:00
1 parent 41e2b1bbba
commit e6d70cf24c
15 files changed
+403 -31

No files matched your search

+2 -2
View File
@@ -221,8 +221,8 @@ func resourcePatchHandler(fileCache FileCache) handleFunc {
dst := r.URL.Query().Get("destination")
action := r.URL.Query().Get("action")
dst, err := url.QueryUnescape(dst)
dst = path.Clean("/" + dst)
src = path.Clean("/" + src)
dst = slashClean(dst)
src = slashClean(src)
if !d.Check(src) || !d.Check(dst) {
return http.StatusForbidden, nil
}