- }).WithContext(ctx)
-
- resp, err := client.Do(reqOut)
- if filter == nil && err != nil {
- httpserver.Error(w, err.Error(), http.StatusBadGateway)
- return
- }
-
- // make sure original response body gets closed
- originalBody := resp.Body
- if originalBody != nil {
- defer originalBody.Close()
- }
-
- if filter != nil {
- resp, err = filter(resp, err)