|
|
@ -131,13 +131,22 @@ func (proxy *Proxy) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
logErr(log, err)
|
|
|
|
logErr(log, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if response.Body != nil && len(response.Body) > 0 {
|
|
|
|
}
|
|
|
|
|
|
|
|
if response.Body != nil {
|
|
|
|
|
|
|
|
if response.BodyReader != nil {
|
|
|
|
|
|
|
|
_, err := io.Copy(res, response.BodyReader)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logErr(log, err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(response.Body) > 0 {
|
|
|
|
_, err := res.Write(response.Body)
|
|
|
|
_, err := res.Write(response.Body)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
logErr(log, err)
|
|
|
|
logErr(log, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// when addons panic
|
|
|
|
// when addons panic
|
|
|
|
defer func() {
|
|
|
|
defer func() {
|
|
|
|