pkg/web: remove Router and Logger from Context (#53765)

web.Context previously held references to the current *web.Router albeit
not using it.

It also had a log.Logger only being used once internally
This commit is contained in:
sh0rez
2022-08-16 12:25:27 +02:00
committed by GitHub
parent 47364ae11f
commit 635571db8a
4 changed files with 4 additions and 16 deletions

View File

@@ -41,8 +41,7 @@ func TestToMacaronPath(t *testing.T) {
func TestAlertingProxy_createProxyContext(t *testing.T) {
ctx := &models.ReqContext{
Context: &web.Context{
Router: web.NewRouter(),
Req: &http.Request{},
Req: &http.Request{},
},
SignedInUser: &user.SignedInUser{},
UserToken: &models.UserToken{},
@@ -92,7 +91,6 @@ func TestAlertingProxy_createProxyContext(t *testing.T) {
newCtx := proxy.createProxyContext(ctx, req, resp)
require.NotEqual(t, ctx.Context.Resp, newCtx.Context.Resp)
require.Equal(t, ctx.Context.Router, newCtx.Context.Router)
require.Equal(t, ctx.Context.Req, newCtx.Context.Req)
require.NotEqual(t, 123, resp.Status())