mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-02 08:57:32 -04:00
parent
63c54f7e1f
commit
ffff835b73
@ -845,7 +845,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||||||
m.Group("/topics", func() {
|
m.Group("/topics", func() {
|
||||||
m.Get("/search", repo.TopicSearch)
|
m.Get("/search", repo.TopicSearch)
|
||||||
})
|
})
|
||||||
}, securityHeaders(), context.APIContexter(), sudo())
|
}, securityHeaders(), reqTokenBySetting(), context.APIContexter(), sudo())
|
||||||
}
|
}
|
||||||
|
|
||||||
func securityHeaders() macaron.Handler {
|
func securityHeaders() macaron.Handler {
|
||||||
@ -857,3 +857,10 @@ func securityHeaders() macaron.Handler {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func reqTokenBySetting() macaron.Handler {
|
||||||
|
if setting.Service.RequireSignInView {
|
||||||
|
return reqToken()
|
||||||
|
}
|
||||||
|
return func(ctx *macaron.Context) {}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user