From 83622e6669d52b019a9d5d5af646ccfe4362cc15 Mon Sep 17 00:00:00 2001 From: Bill Maxwell Date: Wed, 21 Aug 2024 09:24:04 -0700 Subject: [PATCH] chore: add content length when handling json request bodies. Signed-off-by: Bill Maxwell --- pkg/openapi/run.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/openapi/run.go b/pkg/openapi/run.go index 6c7e4ca7..fb3b746c 100644 --- a/pkg/openapi/run.go +++ b/pkg/openapi/run.go @@ -107,6 +107,7 @@ func Run(operationID, defaultHost, args string, t *openapi3.T, envs []string) (s return "", false, fmt.Errorf("failed to encode JSON: %w", err) } req.Header.Set("Content-Type", "application/json") + req.ContentLength = int64(body.Len()) case "text/plain": reqBody := ""