mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-25 20:51:53 +08:00
fix: set depth header
License: MIT Signed-off-by: Henrique Dias <[email protected]>
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