From 7bb32abe7c7f82b002b31bf75b471a4e0617d10a Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Fri, 30 Jun 2023 12:02:17 -0700 Subject: [PATCH] fix: updating the message that's shown for no body in the JSON target --- src/targets/json/native/client.ts | 2 +- src/targets/json/native/fixtures/cookies.json | 1 + src/targets/json/native/fixtures/custom-method.json | 1 + src/targets/json/native/fixtures/headers.json | 1 + src/targets/json/native/fixtures/http-insecure.json | 1 + .../json/native/fixtures/multipart-form-data-no-params.json | 1 + src/targets/json/native/fixtures/nested.json | 1 + src/targets/json/native/fixtures/postdata-malformed.json | 1 + src/targets/json/native/fixtures/query-encoded.json | 1 + src/targets/json/native/fixtures/query.json | 1 + src/targets/json/native/fixtures/short.json | 1 + 11 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/targets/json/native/client.ts b/src/targets/json/native/client.ts index 5bd4e992e..3e1689060 100644 --- a/src/targets/json/native/client.ts +++ b/src/targets/json/native/client.ts @@ -57,7 +57,7 @@ export const native: Client = { } if (typeof payload === undefined || payload === '') { - return ''; + return 'No JSON body'; } return JSON.stringify(payload, null, opts.indent); diff --git a/src/targets/json/native/fixtures/cookies.json b/src/targets/json/native/fixtures/cookies.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/cookies.json +++ b/src/targets/json/native/fixtures/cookies.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/custom-method.json b/src/targets/json/native/fixtures/custom-method.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/custom-method.json +++ b/src/targets/json/native/fixtures/custom-method.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/headers.json b/src/targets/json/native/fixtures/headers.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/headers.json +++ b/src/targets/json/native/fixtures/headers.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/http-insecure.json b/src/targets/json/native/fixtures/http-insecure.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/http-insecure.json +++ b/src/targets/json/native/fixtures/http-insecure.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/multipart-form-data-no-params.json b/src/targets/json/native/fixtures/multipart-form-data-no-params.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/multipart-form-data-no-params.json +++ b/src/targets/json/native/fixtures/multipart-form-data-no-params.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/nested.json b/src/targets/json/native/fixtures/nested.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/nested.json +++ b/src/targets/json/native/fixtures/nested.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/postdata-malformed.json b/src/targets/json/native/fixtures/postdata-malformed.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/postdata-malformed.json +++ b/src/targets/json/native/fixtures/postdata-malformed.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/query-encoded.json b/src/targets/json/native/fixtures/query-encoded.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/query-encoded.json +++ b/src/targets/json/native/fixtures/query-encoded.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/query.json b/src/targets/json/native/fixtures/query.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/query.json +++ b/src/targets/json/native/fixtures/query.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file diff --git a/src/targets/json/native/fixtures/short.json b/src/targets/json/native/fixtures/short.json index e69de29bb..f24694d81 100644 --- a/src/targets/json/native/fixtures/short.json +++ b/src/targets/json/native/fixtures/short.json @@ -0,0 +1 @@ +No JSON body \ No newline at end of file