From 2144774a8ea3d2452de339488aa2064f9c266082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 16 Feb 2023 12:23:21 +0300 Subject: [PATCH] Fix mapping response json field name --- browser/mapping.go | 2 +- browser/mapping_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/mapping.go b/browser/mapping.go index 7cc761d79..6f0cd7641 100644 --- a/browser/mapping.go +++ b/browser/mapping.go @@ -119,7 +119,7 @@ func mapResponse(vu moduleVU, r api.Response) mapping { "headerValues": r.HeaderValues, "headers": r.Headers, "headersArray": r.HeadersArray, - "jSON": r.JSON, + "json": r.JSON, "ok": r.Ok, "request": func() *goja.Object { mr := mapRequest(vu, r.Request()) diff --git a/browser/mapping_test.go b/browser/mapping_test.go index 7d6be565a..6daae98b7 100644 --- a/browser/mapping_test.go +++ b/browser/mapping_test.go @@ -177,6 +177,8 @@ func toFirstLetterLower(s string) string { return strings.ToLower(s[:1]) + s[1:] case "URL": return "url" + case "JSON": + return "json" case "JSONValue": return "jsonValue" }