mirror of
https://github.com/grafana/grafana.git
synced 2024-12-29 10:21:41 -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
|
initCtx.Context = c
|
||||||
c.Req = c.Req.WithContext(ctxkey.Set(c.Req.Context(), initCtx))
|
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)
|
m.ServeHTTP(recorder, request)
|
||||||
|
|
||||||
return recorder
|
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