fix: support for Microsoft WebDAV (#6133 close #6104)

* Add support for Microsoft WebDAV

* add import
This commit is contained in:
wolfsilver
2024-03-02 14:59:55 +08:00
committed by GitHub
parent 71e4e1ab6e
commit f8b1f87a5f
2 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,7 @@
package webdav // import "golang.org/x/net/webdav"
import (
"context"
"errors"
"fmt"
"net/http"
@ -619,6 +620,8 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status
return status, err
}
ctx := r.Context()
userAgent := r.Header.Get("User-Agent")
ctx = context.WithValue(ctx, "userAgent", userAgent)
user := ctx.Value("user").(*model.User)
reqPath, err = user.JoinPath(reqPath)
if err != nil {