Corrections de quelques bugs
This commit is contained in:
parent
3ad84eb465
commit
562570618d
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue