From 7018241aa0de4b422fccfd20eb4080af513072bd Mon Sep 17 00:00:00 2001 From: Chris Novakovic Date: Mon, 19 Feb 2024 12:17:00 +0000 Subject: [PATCH] CookieAuthTransport: check for JSON encoding errors when building auth request --- jira.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jira.go b/jira.go index 25c52bae..a510625f 100644 --- a/jira.go +++ b/jira.go @@ -536,7 +536,10 @@ func (t *CookieAuthTransport) buildAuthRequest() (*http.Request, error) { } b := new(bytes.Buffer) - json.NewEncoder(b).Encode(body) + err := json.NewEncoder(b).Encode(body) + if err != nil { + return nil, fmt.Errorf("encode request body: %w", err) + } req, err := http.NewRequest("POST", t.AuthURL, b) if err != nil {