mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user