]> source.dussan.org Git - gitea.git/commitdiff
Revert "API should follow RequireSignInView (#8654)" (#8675)
authorLunny Xiao <xiaolunwen@gmail.com>
Thu, 24 Oct 2019 21:10:48 +0000 (05:10 +0800)
committerzeripath <art27@cantab.net>
Thu, 24 Oct 2019 21:10:48 +0000 (22:10 +0100)
This reverts commit 3c63c3ace4bff1e0e796759a4676fcfff3c5c872.

routers/api/v1/api.go

index 88791e023339a5ebddfd6f4f528c18d266d1415a..f8ab9025b780ec753ec863e884c7bc4a880cbb6d 100644 (file)
@@ -862,7 +862,7 @@ func RegisterRoutes(m *macaron.Macaron) {
                m.Group("/topics", func() {
                        m.Get("/search", repo.TopicSearch)
                })
-       }, securityHeaders(), reqTokenBySetting(), context.APIContexter(), sudo())
+       }, securityHeaders(), context.APIContexter(), sudo())
 }
 
 func securityHeaders() macaron.Handler {
@@ -874,10 +874,3 @@ func securityHeaders() macaron.Handler {
                })
        }
 }
-
-func reqTokenBySetting() macaron.Handler {
-       if setting.Service.RequireSignInView {
-               return reqToken()
-       }
-       return func(ctx *macaron.Context) {}
-}