Skip to content

Commit

Permalink
make /{username}.png redirect to user/org avatar (#22356)
Browse files Browse the repository at this point in the history
fix #22355

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
crystalcommunication and lunny authored Jan 6, 2023
1 parent 3dbd2d9 commit d42b52f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func RegisterRoutes(m *web.Route) {
http.ServeFile(ctx.Resp, ctx.Req, path.Join(setting.StaticRootPath, "public/img/favicon.png"))
})
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(".gpg", user.ShowGPGKeys)
m.Get(".rss", feedEnabled, feed.ShowUserFeedRSS)
Expand Down

0 comments on commit d42b52f

Please sign in to comment.