mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
feat(perf): remove unused size url parameter for local avatars (#10932)
Avatars storage handler ignores the size= url parameter, and we don't have any code for creating multiple sizes of the same avatar. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10932 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
This commit is contained in:
parent
7f22f525fc
commit
10aaef5c7b
4 changed files with 5 additions and 13 deletions
|
|
@ -165,10 +165,7 @@ func GenerateUserAvatarFastLink(userName string, size int) string {
|
|||
}
|
||||
|
||||
// GenerateUserAvatarImageLink returns a link for `User.Avatar` image file: "/avatars/${User.Avatar}"
|
||||
func GenerateUserAvatarImageLink(userAvatar string, size int) string {
|
||||
if size > 0 {
|
||||
return setting.AppSubURL + "/avatars/" + url.PathEscape(userAvatar) + "?size=" + strconv.Itoa(size)
|
||||
}
|
||||
func GenerateUserAvatarImageLink(userAvatar string) string {
|
||||
return setting.AppSubURL + "/avatars/" + url.PathEscape(userAvatar)
|
||||
}
|
||||
|
||||
|
|
@ -210,9 +207,6 @@ func generateEmailAvatarLink(ctx context.Context, email string, size int, final
|
|||
}
|
||||
// for non-final link, we should return fast (use a 302 redirection link)
|
||||
urlStr := setting.AppSubURL + "/avatar/" + url.PathEscape(emailHash)
|
||||
if size > 0 {
|
||||
urlStr += "?size=" + strconv.Itoa(size)
|
||||
}
|
||||
return urlStr
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue