* Contexthandler: Add uname as response header (#59930)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
(cherry picked from commit 1b676d0d49)
* fixes tests broken due to moved featuremgt package
Signed-off-by: bergquist <carl.bergquist@gmail.com>
Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
@@ -636,6 +636,7 @@ func middlewareScenario(t *testing.T, desc string, fn scenarioFunc, cbs ...func(
|
||||
loginMaxLifetime, err := gtime.ParseDuration("30d")
|
||||
require.NoError(t, err)
|
||||
cfg := setting.NewCfg()
|
||||
cfg.IsFeatureToggleEnabled = func(key string) bool { return false }
|
||||
cfg.LoginCookieName = "grafana_session"
|
||||
cfg.LoginMaxLifetime = loginMaxLifetime
|
||||
// Required when rendering errors
|
||||
|
||||
@@ -48,6 +48,7 @@ func panicHandler(c *models.ReqContext) {
|
||||
func recoveryScenario(t *testing.T, desc string, url string, fn scenarioFunc) {
|
||||
t.Run(desc, func(t *testing.T) {
|
||||
cfg := setting.NewCfg()
|
||||
cfg.IsFeatureToggleEnabled = func(key string) bool { return true }
|
||||
cfg.ErrTemplateName = "error-template"
|
||||
sc := &scenarioContext{
|
||||
t: t,
|
||||
@@ -67,7 +68,7 @@ func recoveryScenario(t *testing.T, desc string, url string, fn scenarioFunc) {
|
||||
sc.userAuthTokenService = auth.NewFakeUserAuthTokenService()
|
||||
sc.remoteCacheService = remotecache.NewFakeStore(t)
|
||||
|
||||
contextHandler := getContextHandler(t, nil, nil, nil, nil, nil)
|
||||
contextHandler := getContextHandler(t, cfg, nil, nil, nil, nil)
|
||||
sc.m.Use(contextHandler.Middleware)
|
||||
// mock out gc goroutine
|
||||
sc.m.Use(OrgRedirect(cfg, sc.mockSQLStore))
|
||||
|
||||
Reference in New Issue
Block a user