def handle_response(self, msg): """ Receives HTTP response, and sends it to logging function """ msg.reply() # attempts to get the top url, based on the request object if msg.request in self.prev_requests: top_url = self.prev_top_url self.prev_requests.remove(msg.request) elif msg.request in self.curr_requests: top_url = self.curr_top_url self.curr_requests.remove(msg.request) else: # ignore responses for which we cannot match the request return mitm_commands.process_general_mitm_response(self.db_socket, self.crawl_id, top_url, msg)
def handle_response(self, msg): """ Receives HTTP response, and sends it to logging function """ msg.reply() # attempts to get the top url visit id, based on the request object if msg.request in self.prev_requests: visit_id = self.prev_visit_id self.prev_requests.remove(msg.request) elif msg.request in self.curr_requests: visit_id = self.curr_visit_id self.curr_requests.remove(msg.request) else: # ignore responses for which we cannot match the request return mitm_commands.process_general_mitm_response(self.db_socket, self.ldb_socket, self.logger, self.browser_params, visit_id, msg)