From 3986f7a02223701a6641a9ab4c8942bcd91cf017 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 18 Apr 2021 17:53:53 +0200 Subject: [PATCH] fix: remove recoverer and body closer; must be users' responsability --- handler.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/handler.go b/handler.go index d91f086..b6feeb3 100644 --- a/handler.go +++ b/handler.go @@ -1,7 +1,6 @@ package aicra import ( - "log" "net/http" "git.xdrm.io/go/aicra/api" @@ -23,15 +22,6 @@ func (s Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func (s Handler) handleRequest(w http.ResponseWriter, r *http.Request) { - defer func() { - if rc := recover(); rc != nil { - log.Printf("recovering request: %s\n", rc) - // try to send error response - api.EmptyResponse().WithError(api.ErrUncallableService).ServeHTTP(w, r) - } - }() - defer r.Body.Close() - // 1. find a matching service from config var service = s.conf.Find(r) if service == nil {