From c8ef7eb4f2a9643c00b3f7b58db8765a11a313b6 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Wed, 5 Feb 2025 03:22:20 -0800 Subject: [PATCH] fix: log unsuccessful webhook response body as a string (#16439) --- coderd/notifications/dispatch/webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/notifications/dispatch/webhook.go b/coderd/notifications/dispatch/webhook.go index 1322996db1..65d6ed030a 100644 --- a/coderd/notifications/dispatch/webhook.go +++ b/coderd/notifications/dispatch/webhook.go @@ -106,7 +106,7 @@ func (w *WebhookHandler) dispatch(msgPayload types.MessagePayload, titlePlaintex return true, xerrors.Errorf("non-2xx response (%d), read body: %w", resp.StatusCode, err) } w.log.Warn(ctx, "unsuccessful delivery", slog.F("status_code", resp.StatusCode), - slog.F("response", respBody[:n]), slog.F("msg_id", msgID)) + slog.F("response", string(respBody[:n])), slog.F("msg_id", msgID)) return true, xerrors.Errorf("non-2xx response (%d)", resp.StatusCode) }