mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Macaron: remove custom Request type (#37874)
* remove macaron.Request, use http.Request instead * remove com dependency from bindings module * fix another c.Req.Request
This commit is contained in:
@@ -61,7 +61,7 @@ func Logger(cfg *setting.Cfg) macaron.Handler {
|
||||
"referer", req.Referer(),
|
||||
}
|
||||
|
||||
traceID, exist := cw.ExtractTraceID(ctxTyped.Req.Request.Context())
|
||||
traceID, exist := cw.ExtractTraceID(ctxTyped.Req.Context())
|
||||
if exist {
|
||||
logParams = append(logParams, "traceID", traceID)
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ var routeOperationNameKey = contextKey{}
|
||||
func ProvideRouteOperationName(name string) macaron.Handler {
|
||||
return func(res http.ResponseWriter, req *http.Request, c *macaron.Context) {
|
||||
ctx := context.WithValue(c.Req.Context(), routeOperationNameKey, name)
|
||||
c.Req.Request = c.Req.WithContext(ctx)
|
||||
c.Req = c.Req.WithContext(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func RequestTracing() macaron.Handler {
|
||||
span := tracer.StartSpan(fmt.Sprintf("HTTP %s %s", req.Method, req.URL.Path), ext.RPCServerOption(wireContext))
|
||||
|
||||
ctx := opentracing.ContextWithSpan(req.Context(), span)
|
||||
c.Req.Request = req.WithContext(ctx)
|
||||
c.Req = req.WithContext(ctx)
|
||||
|
||||
c.Next()
|
||||
|
||||
|
Reference in New Issue
Block a user