Browse Source

Revert "API should follow RequireSignInView (#8654)" (#8675)

This reverts commit 3c63c3ace4.
tags/v1.11.0-rc1
Lunny Xiao 4 years ago
parent
commit
0a80164bec
1 changed files with 1 additions and 8 deletions
  1. 1
    8
      routers/api/v1/api.go

+ 1
- 8
routers/api/v1/api.go View 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) {}
}

Loading…
Cancel
Save