From d2eef546d588556d931a0deed8282ab0a5262dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Fri, 22 Sep 2023 22:35:16 +0200 Subject: [PATCH] Remove unnecessary Body.close() calls The server will close those. --- main.go | 2 -- silence.go | 2 -- 2 files changed, 4 deletions(-) diff --git a/main.go b/main.go index aec085f..2bf7fa4 100644 --- a/main.go +++ b/main.go @@ -384,8 +384,6 @@ func (br *bridge) publish(n *notification) error { } func (br *bridge) handleWebhooks(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - logger := br.logger.With(slog.String("handler", "/")) if r.Method != http.MethodPost { diff --git a/silence.go b/silence.go index 01da866..d8060bb 100644 --- a/silence.go +++ b/silence.go @@ -38,8 +38,6 @@ type silenceResponse struct { } func (br *bridge) handleSilences(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - logger := br.logger.With(slog.String("handler", "/silences")) if r.Method != http.MethodPost {