use Subdir instead of Username in filepath

This commit is contained in:
Joerg Linge 2018-04-23 17:33:36 +02:00 committed by GitHub
parent c8efd4fe65
commit 0aa238477f
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)))
}
}