From bc66ef34df1b0c1a3d75666e94a369f247f55687 Mon Sep 17 00:00:00 2001 From: mzack Date: Thu, 19 Aug 2021 15:31:26 +0200 Subject: [PATCH] Fixing priority in response to DSL mapping --- v2/pkg/protocols/http/operators.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/v2/pkg/protocols/http/operators.go b/v2/pkg/protocols/http/operators.go index dc72044a..81320de8 100644 --- a/v2/pkg/protocols/http/operators.go +++ b/v2/pkg/protocols/http/operators.go @@ -91,14 +91,6 @@ func (r *Request) responseToDSLMap(resp *http.Response, host, matched, rawReq, r for k, v := range extra { data[k] = v } - - data["host"] = host - data["matched"] = matched - data["request"] = rawReq - data["response"] = rawResp - data["content_length"] = resp.ContentLength - data["status_code"] = resp.StatusCode - data["body"] = body for _, cookie := range resp.Cookies() { data[strings.ToLower(cookie.Name)] = cookie.Value } @@ -106,6 +98,13 @@ func (r *Request) responseToDSLMap(resp *http.Response, host, matched, rawReq, r k = strings.ToLower(strings.ReplaceAll(strings.TrimSpace(k), "-", "_")) data[k] = strings.Join(v, " ") } + data["host"] = host + data["matched"] = matched + data["request"] = rawReq + data["response"] = rawResp + data["status_code"] = resp.StatusCode + data["body"] = body + data["content_length"] = resp.ContentLength data["all_headers"] = headers data["duration"] = duration.Seconds() data["template-id"] = r.options.TemplateID