Skip to content

Commit

Permalink
CookieAuthTransport: check for JSON encoding errors when building aut…
Browse files Browse the repository at this point in the history
…h request
  • Loading branch information
chrisnovakovic committed Feb 19, 2024
1 parent 4678b7c commit 7018241
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7018241

Please sign in to comment.