full path to avatars

This commit is contained in:
Umputun
2018-02-17 18:26:45 -06:00
parent 24fefc1c3a
commit 90f840a30a
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -103,6 +103,7 @@ func main() {
avatarProxy := &auth.AvatarProxy{
StorePath: opts.ServerCommand.AvatarStore,
RoutePath: "/api/v1/avatar",
RemarkURL: opts.RemarkURL,
DefaultAvatar: opts.ServerCommand.DefaultAvatar,
}
+2 -1
View File
@@ -25,6 +25,7 @@ type AvatarProxy struct {
StorePath string
DefaultAvatar string
RoutePath string
RemarkURL string
}
const imgSfx = ".image"
@@ -77,7 +78,7 @@ func (p *AvatarProxy) Put(u store.User) (avatarURL string, err error) {
}
log.Printf("[DEBUG] saved avatar from %s to %s, user %q", u.Picture, avFile, u.Name)
return p.RoutePath + "/" + encID + imgSfx, nil
return p.RemarkURL + p.RoutePath + "/" + encID + imgSfx, nil
}
// Routes returns auth routes for given provider