From a54c428670a373acc9810140cb7b4e95bc6b59ea Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 19 Nov 2019 17:00:11 +0100 Subject: [PATCH] Test json: add a check with invalid json (no parameter is parsed) --- internal/reqdata/store_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/reqdata/store_test.go b/internal/reqdata/store_test.go index 7327f5b..6866a8f 100644 --- a/internal/reqdata/store_test.go +++ b/internal/reqdata/store_test.go @@ -463,6 +463,13 @@ func TestJsonParameters(t *testing.T) { ParamNames: []string{"a", "URL#injection"}, ParamValues: []interface{}{"b", nil}, }, + // json parse error + { + RawJson: "{ \"a\": \"b\", }", + InvalidNames: []string{}, + ParamNames: []string{}, + ParamValues: []interface{}{}, + }, } for i, test := range tests {