Skip to content

Commit

Permalink
fix(subsonic): fix getAvatar user request comparison (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-doherty committed Feb 13, 2024
1 parent 19ebd45 commit 2949b4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/ctrlsubsonic/handlers_raw.go
Expand Up @@ -242,7 +242,7 @@ func (c *Controller) ServeGetAvatar(w http.ResponseWriter, r *http.Request) *spe
return spec.NewError(10, "please provide an `username` parameter")
}
reqUser := c.dbc.GetUserByName(username)
if (user != reqUser) && !user.IsAdmin {
if (user.ID != reqUser.ID) && !user.IsAdmin {
return spec.NewError(50, "user not admin")
}
http.ServeContent(w, r, "", time.Now(), bytes.NewReader(reqUser.Avatar))
Expand Down

0 comments on commit 2949b4c

Please sign in to comment.