Merge pull request #2 from lingej/patch-1

Use subdir instead of username in filepath
This commit is contained in:
Christian Claus 2018-04-23 19:42:19 +02:00 committed by GitHub
commit 32fcc094b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,7 +46,7 @@ func (d Dir) resolve(ctx context.Context, name string) string {
if authInfo != nil && authInfo.Authenticated {
userInfo := d.Config.Users[authInfo.Username]
if userInfo != nil && userInfo.Subdir != nil {
return filepath.Join(dir, authInfo.Username, filepath.FromSlash(path.Clean("/"+name)))
return filepath.Join(dir, *userInfo.Subdir, filepath.FromSlash(path.Clean("/"+name)))
}
}