fix: fixed non fatal error while http.proxy is running

This commit is contained in:
evilsocket 2018-01-27 16:52:08 +01:00
commit ef69f4ae67

View file

@ -86,6 +86,7 @@ func NewHTTPProxy(s *session.Session) *HTTPProxy {
})
p.Proxy.OnResponse().DoFunc(func(res *http.Response, ctx *goproxy.ProxyCtx) *http.Response {
if res != nil {
req := res.Request
log.Debug("(%s) > %s %s %s%s", core.Green(p.Name), req.RemoteAddr, req.Method, req.Host, req.URL.Path)
if p.Script != nil {
@ -95,6 +96,7 @@ func NewHTTPProxy(s *session.Session) *HTTPProxy {
return jsres.ToResponse(res.Request)
}
}
}
return res
})