fix: lock files across different users

Fixes #66.
This commit is contained in:
Henrique Dias
2025-05-17 10:53:07 +02:00
parent e350dc989a
commit 5226853fca
2 changed files with 45 additions and 2 deletions
+10 -2
View File
@@ -23,6 +23,8 @@ type Handler struct {
}
func NewHandler(c *Config) (http.Handler, error) {
ls := webdav.NewMemLS()
h := &Handler{
noPassword: c.NoPassword,
behindProxy: c.BehindProxy,
@@ -36,7 +38,10 @@ func NewHandler(c *Config) (http.Handler, error) {
Dir: webdav.Dir(c.Directory),
noSniff: c.NoSniff,
},
LockSystem: webdav.NewMemLS(),
LockSystem: &lockSystem{
LockSystem: ls,
directory: c.Directory,
},
},
},
users: map[string]*handlerUser{},
@@ -51,7 +56,10 @@ func NewHandler(c *Config) (http.Handler, error) {
Dir: webdav.Dir(u.Directory),
noSniff: c.NoSniff,
},
LockSystem: webdav.NewMemLS(),
LockSystem: &lockSystem{
LockSystem: ls,
directory: u.Directory,
},
},
}
}