예제 #1
0
 def request(self, f):
     if f.live:
         app = self.apps.get(f.request)
         if app:
             err = app.serve(
                 f,
                 f.client_conn.wfile,
                 **{"mitmproxy.master": self}
             )
             if err:
                 self.add_event("Error in wsgi app. %s" % err, "error")
             f.reply.kill()
             return
     if f not in self.state.flows:  # don't add again on replay
         self.state.add_flow(f)
     self.active_flows.add(f)
     if not f.reply.acked:
         self.replacehooks.run(f)
     if not f.reply.acked:
         self.setheaders.run(f)
     if not f.reply.acked:
         self.process_new_request(f)
     if not f.reply.acked:
         self.run_scripts("request", f)
     return f
예제 #2
0
 def request(self, f):
     if f.live:
         app = self.apps.get(f.request)
         if app:
             err = app.serve(f, f.client_conn.wfile,
                             **{"mitmproxy.master": self})
             if err:
                 self.add_log("Error in wsgi app. %s" % err, "error")
             f.reply.kill()
             return
     if f not in self.state.flows:  # don't add again on replay
         self.state.add_flow(f)
예제 #3
0
 def request(self, f):
     if f.live:
         app = self.apps.get(f.request)
         if app:
             err = app.serve(
                 f,
                 f.client_conn.wfile,
                 **{"mitmproxy.master": self}
             )
             if err:
                 self.add_log("Error in wsgi app. %s" % err, "error")
             f.reply.kill()
             return
     if f not in self.state.flows:  # don't add again on replay
         self.state.add_flow(f)