Browse Source

Enclosed in debug httpclient.Do errors.

Eliezer Croitoru 6 months ago
parent
commit
829e7de963
1 changed files with 4 additions and 1 deletions
  1. 4 1
      icap-js-injection-example.go

+ 4 - 1
icap-js-injection-example.go

@@ -344,10 +344,13 @@ func htmlJSInject(w icap.ResponseWriter, req *icap.Request) {
 
 			originalResp, err := client.Do(newReq)
 			if err != nil {
-				fmt.Println(err)
+				if *debug {
+					fmt.Println(err)
+				}
 				w.WriteHeader(204, nil, false)
 				return
 			}
+
 			resp := new(http.Response)
 			resp.Status = originalResp.Status
 			resp.StatusCode = originalResp.StatusCode