Remove unnecessary Body.close() calls

The server will close those.
This commit is contained in:
Thorben Günther 2023-09-22 22:35:16 +02:00
parent 86afe915f3
commit d2eef546d5
No known key found for this signature in database
GPG key ID: 415CD778D8C5AFED
2 changed files with 0 additions and 4 deletions

View file

@ -384,8 +384,6 @@ func (br *bridge) publish(n *notification) error {
} }
func (br *bridge) handleWebhooks(w http.ResponseWriter, r *http.Request) { func (br *bridge) handleWebhooks(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
logger := br.logger.With(slog.String("handler", "/")) logger := br.logger.With(slog.String("handler", "/"))
if r.Method != http.MethodPost { if r.Method != http.MethodPost {

View file

@ -38,8 +38,6 @@ type silenceResponse struct {
} }
func (br *bridge) handleSilences(w http.ResponseWriter, r *http.Request) { func (br *bridge) handleSilences(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
logger := br.logger.With(slog.String("handler", "/silences")) logger := br.logger.With(slog.String("handler", "/silences"))
if r.Method != http.MethodPost { if r.Method != http.MethodPost {