pkg/web: remove dependency injection (#49123)
* pkg/web: store http.Handler internally * pkg/web: remove injection Removes any injection code from pkg/web. It already was no longer functional, as we already only injected into `http.Handler`, meaning we only inject ctx.Req and ctx.Resp. Any other types (*Context, *ReqContext) were already accessed using the http.Request.Context.Value() method. * *: remove type mappings Removes any call to the previously removed TypeMapper, as those were non-functional already. * pkg/web: remove Context.Invoke was no longer used outside of pkg/web and also no longer functional
This commit is contained in:
@@ -56,7 +56,6 @@ func RequestMetrics(features featuremgmt.FeatureToggles) web.Handler {
|
||||
now := time.Now()
|
||||
httpRequestsInFlight.Inc()
|
||||
defer httpRequestsInFlight.Dec()
|
||||
c.Map(c.Req)
|
||||
c.Next()
|
||||
|
||||
handler := "unknown"
|
||||
|
||||
@@ -55,8 +55,6 @@ func RequestTracing(tracer tracing.Tracer) web.Handler {
|
||||
ctx, span := tracer.Start(req.Context(), fmt.Sprintf("HTTP %s %s", req.Method, req.URL.Path), trace.WithLinks(trace.LinkFromContext(wireContext)))
|
||||
|
||||
c.Req = req.WithContext(ctx)
|
||||
c.Map(c.Req)
|
||||
|
||||
c.Next()
|
||||
|
||||
// Only call span.Finish when a route operation name have been set,
|
||||
|
||||
Reference in New Issue
Block a user