From baa6f60384628c8ad9b8ce1dd30468c8a390d0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20S=CC=8Ctibrany=CC=81?= Date: Tue, 18 Feb 2020 16:22:26 +0100 Subject: [PATCH] Changed var name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Štibraný --- util/httputil/context.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/httputil/context.go b/util/httputil/context.go index 5b0b983cb2..10169d8901 100644 --- a/util/httputil/context.go +++ b/util/httputil/context.go @@ -34,23 +34,23 @@ func ContextWithPath(ctx context.Context, path string) context.Context { // ContextFromRequest returns a new context from a requests with identifiers of // the request to be used later when logging the query. func ContextFromRequest(ctx context.Context, r *http.Request) context.Context { - m := map[string]string{ + reqCtxVal := map[string]string{ "method": r.Method, } // r.RemoteAddr has no defined format, so don't return error if we cannot split it into IP:Port. ip, _, _ := net.SplitHostPort(r.RemoteAddr) if ip != "" { - m["clientIP"] = ip + reqCtxVal["clientIP"] = ip } var path string if v := ctx.Value(pathParam); v != nil { path = v.(string) - m["path"] = path + reqCtxVal["path"] = path } return promql.NewOriginContext(ctx, map[string]interface{}{ - "httpRequest": m, + "httpRequest": reqCtxVal, }) }