diff --git a/internal/log/http.go b/internal/log/http.go index 1091e5706c09be374e6775f8906c91505e10b33f..2c74bd05201ad9cbd8d60c6e3c3db3f637fb99b3 100644 --- a/internal/log/http.go +++ b/internal/log/http.go @@ -79,6 +79,9 @@ func (h *HTTPRoundTripLogger) RoundTrip(req *http.Request) (*http.Response, erro } func bodyToString(body io.ReadCloser) string { + if body == nil { + return "" + } src, err := io.ReadAll(body) if err != nil { slog.Error("Failed to read body", "error", err)