Skip to content

Commit

Permalink
Revert "API should follow RequireSignInView (#8654)"
Browse files Browse the repository at this point in the history
This reverts commit 3c63c3a.
  • Loading branch information
lunny authored Oct 24, 2019
1 parent 3c63c3a commit 3ee28d2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -874,10 +874,3 @@ func securityHeaders() macaron.Handler {
})
}
}

func reqTokenBySetting() macaron.Handler {
if setting.Service.RequireSignInView {
return reqToken()
}
return func(ctx *macaron.Context) {}
}

0 comments on commit 3ee28d2

Please sign in to comment.