MCPcopy Index your code
hub / github.com/bettercap/bettercap / OnResponse

Method OnResponse

modules/http_proxy/http_proxy_script.go:97–111  ·  view source on GitHub ↗
(res *http.Response)

Source from the content-addressed store, hash-verified

95}
96
97func (s *HttpProxyScript) OnResponse(res *http.Response) (jsreq *JSRequest, jsres *JSResponse) {
98 if s.doOnResponse {
99 jsreq := NewJSRequest(res.Request)
100 jsres := NewJSResponse(res)
101
102 if _, err := s.Call("onResponse", jsreq, jsres); err != nil {
103 log.Error("%s", err)
104 return nil, nil
105 } else if jsres.CheckIfModifiedAndUpdateHash() {
106 return nil, jsres
107 }
108 }
109
110 return nil, nil
111}
112
113func (s *HttpProxyScript) OnCommand(cmd string) bool {
114 if s.doOnCommand {

Callers 2

NewHTTPProxyFunction · 0.45
onResponseFilterMethod · 0.45

Calls 4

ErrorFunction · 0.92
NewJSRequestFunction · 0.85
NewJSResponseFunction · 0.85

Tested by

no test coverage detected