feat: add URL prefix(subpath) support (#31)

To adapt to situations such as working behind a reverse proxy dispatching query to different services by URL path prefix
This commit is contained in:
Shun Zi
2019-11-08 13:01:42 +00:00
committed by Henrique Dias
parent ab0334f036
commit 2971f7ed3d
3 changed files with 4 additions and 0 deletions
+2
View File
@@ -114,6 +114,7 @@ func parseUsers(raw []interface{}, c *webdav.Config) {
}
user.Handler = &wd.Handler{
Prefix: c.User.Handler.Prefix,
FileSystem: wd.Dir(user.Scope),
LockSystem: wd.NewMemLS(),
}
@@ -170,6 +171,7 @@ func readConfig(flags *pflag.FlagSet) *webdav.Config {
Modify: getOptB(flags, "modify"),
Rules: []*webdav.Rule{},
Handler: &wd.Handler{
Prefix: getOpt(flags, "prefix"),
FileSystem: wd.Dir(getOpt(flags, "scope")),
LockSystem: wd.NewMemLS(),
},