mirror of
https://github.com/grafana/grafana.git
synced 2024-12-28 18:01:40 -06:00
Fix middleware tests for public dashboards (#53557)
This commit is contained in:
parent
7924d3b3b5
commit
7554322327
@ -68,8 +68,14 @@ func runMiddleware(request *http.Request, pubdashService *publicdashboardsServic
|
||||
initCtx.Context = c
|
||||
c.Req = c.Req.WithContext(ctxkey.Set(c.Req.Context(), initCtx))
|
||||
})
|
||||
m.Get("/api/public/ma/events/:accessToken", RequiresValidAccessToken(pubdashService))
|
||||
m.Get("/api/public/ma/events/:accessToken", RequiresValidAccessToken(pubdashService), mockValidRequestHandler)
|
||||
m.ServeHTTP(recorder, request)
|
||||
|
||||
return recorder
|
||||
}
|
||||
|
||||
func mockValidRequestHandler(c *models.ReqContext) {
|
||||
resp := make(map[string]interface{})
|
||||
resp["message"] = "Valid request"
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user