Verify token before querying index
This commit is contained in:
@ -111,8 +111,12 @@ func ServeClicks(db *b.DB) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func QueryArticles(i *b.Index) http.HandlerFunc {
|
||||
func QueryArticles(c *b.Config, i *b.Index) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if !tokenIsVerified(w, r, c) {
|
||||
return
|
||||
}
|
||||
|
||||
result, err := i.Query(r.PathValue("query"))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
Reference in New Issue
Block a user