mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-22 03:20:41 +08:00
Merge pull request #13 from hacdias/fix/set-depth-header
fix: set depth header
This commit is contained in:
@@ -57,6 +57,10 @@ func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
info, err := u.Handler.FileSystem.Stat(context.TODO(), r.URL.Path)
|
info, err := u.Handler.FileSystem.Stat(context.TODO(), r.URL.Path)
|
||||||
if err == nil && info.IsDir() {
|
if err == nil && info.IsDir() {
|
||||||
r.Method = "PROPFIND"
|
r.Method = "PROPFIND"
|
||||||
|
|
||||||
|
if r.Header.Get("Depth") == "" {
|
||||||
|
r.Header.Add("Depth", "1")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user