mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 00:15:11 +01:00
fix (webdav): network drive via window
This commit is contained in:
parent
753e76d4af
commit
f53dc6a7a3
1 changed files with 10 additions and 0 deletions
|
|
@ -105,6 +105,12 @@ func (this *WebdavFs) Stat(ctx context.Context, name string) (os.FileInfo, error
|
|||
return this.webdavFile.Stat()
|
||||
}
|
||||
fullname := this.fullpath(name)
|
||||
if isMicrosoftWebDAVClient(this.req) && this.req.Method == "PROPFIND" {
|
||||
if name == "" {
|
||||
fullname = this.chroot
|
||||
}
|
||||
fullname = EnforceDirectory(fullname)
|
||||
}
|
||||
if fullname == "" {
|
||||
return nil, os.ErrNotExist
|
||||
}
|
||||
|
|
@ -328,3 +334,7 @@ func NewWebdavLock() webdav.LockSystem {
|
|||
}
|
||||
return lock
|
||||
}
|
||||
|
||||
func isMicrosoftWebDAVClient(req *http.Request) bool {
|
||||
return strings.HasPrefix(req.Header.Get("User-Agent"), "Microsoft-WebDAV-MiniRedir/")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue