mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Fix setting HTTP headers after write (#21833)
The headers can't be modified after it was send to the client.
This commit is contained in:
@ -604,7 +604,10 @@ func RegisterRoutes(m *web.Route) {
|
||||
|
||||
m.Group("", func() {
|
||||
m.Get("/favicon.ico", func(ctx *context.Context) {
|
||||
ctx.ServeFile(path.Join(setting.StaticRootPath, "public/img/favicon.png"))
|
||||
ctx.SetServeHeaders(&context.ServeHeaderOptions{
|
||||
Filename: "favicon.png",
|
||||
})
|
||||
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) })
|
||||
|
Reference in New Issue
Block a user