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

@@ -24,8 +24,6 @@ import (
"context"
"net/http"
"strings"
"github.com/grafana/grafana/pkg/infra/log"
)
const _VERSION = "1.3.4.0805"
@@ -147,10 +145,8 @@ func mwFromHandler(handler Handler) Middleware {
func (m *Macaron) createContext(rw http.ResponseWriter, req *http.Request) *Context {
c := &Context{
mws: m.mws,
Router: m.Router,
Resp: NewResponseWriter(req.Method, rw),
logger: log.New("macaron.context"),
mws: m.mws,
Resp: NewResponseWriter(req.Method, rw),
}
c.Req = req.WithContext(context.WithValue(req.Context(), macaronContextKey{}, c))