mirror of
1
Fork 0

make /{username}.png redirect to user/org avatar (#22356)

fix #22355

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
crystal 2023-01-06 05:44:02 -07:00 committed by GitHub
parent 3dbd2d942b
commit d42b52fcfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -634,7 +634,7 @@ func RegisterRoutes(m *web.Route) {
http.ServeFile(ctx.Resp, ctx.Req, path.Join(setting.StaticRootPath, "public/img/favicon.png")) http.ServeFile(ctx.Resp, ctx.Req, path.Join(setting.StaticRootPath, "public/img/favicon.png"))
}) })
m.Group("/{username}", func() { m.Group("/{username}", func() {
m.Get(".png", func(ctx *context.Context) { ctx.Error(http.StatusNotFound) }) m.Get(".png", user.AvatarByUserName)
m.Get(".keys", user.ShowSSHKeys) m.Get(".keys", user.ShowSSHKeys)
m.Get(".gpg", user.ShowGPGKeys) m.Get(".gpg", user.ShowGPGKeys)
m.Get(".rss", feedEnabled, feed.ShowUserFeedRSS) m.Get(".rss", feedEnabled, feed.ShowUserFeedRSS)