Trim result body as well

This commit is contained in:
TwinProduction 2020-07-24 12:46:43 -04:00
parent b05ae1c2d2
commit 60e30da7e5

View File

@ -18,6 +18,7 @@ const (
func sanitizeAndResolve(list []string, result *Result) []string {
var sanitizedList []string
body := strings.TrimSpace(string(result.Body))
for _, element := range list {
element = strings.TrimSpace(element)
switch strings.ToUpper(element) {
@ -28,7 +29,7 @@ func sanitizeAndResolve(list []string, result *Result) []string {
case ResponseTimePlaceHolder:
element = strconv.Itoa(int(result.Duration.Milliseconds()))
case BodyPlaceHolder:
element = string(result.Body)
element = body
default:
// if starts with BodyPlaceHolder, then evaluate json path
if strings.HasPrefix(element, BodyPlaceHolder) {