Corrections de quelques bugs

This commit is contained in:
Laurent Ulrich 2025-01-27 10:12:35 +01:00
parent 3ad84eb465
commit 562570618d
1 changed files with 2 additions and 2 deletions

View File

@ -36,13 +36,13 @@ func forwardRequestToBackend(wg *sync.WaitGroup, client *http.Client, backend st
resp, err := client.Do(forwardReq) resp, err := client.Do(forwardReq)
if err != nil { if err != nil {
log.Printf("Error forwarding to %s: %v", backend, err) log.Printf("Error forwarding to %s: %v", backend, err)
responses <- fmt.Sprintf("%s failed: %v", err) responses <- fmt.Sprintf("%s failed: %v", backend, err)
return return
} }
defer resp.Body.Close() defer resp.Body.Close()
// Read response body // Read response body
body, err := io.ReadAll(resp.Body) _, err = io.ReadAll(resp.Body)
if err != nil { if err != nil {
log.Printf("Error reading response from %s: %v", backend, err) log.Printf("Error reading response from %s: %v", backend, err)
responses <- fmt.Sprintf("%s failed: %v", backend, err) responses <- fmt.Sprintf("%s failed: %v", backend, err)