Esempio n. 1
0
    def request(self, flow: HTTPFlow):
        try:
            audit_logs.emit(
                audit_logs.records.VaultRequestAuditLogRecord(
                    flow_id=flow.id,
                    proxy_mode=ctx.get_proxy_context().mode,
                    method=flow.request.method,
                    uri=flow.request.url,
                ))
            flow.request_raw = flow.request.copy()
            self._process(flow, Phase.REQUEST)

        except (RedactFailed, RevealFailed) as exc:
            logger.error(exc)

        except Exception as exc:
            logger.exception(exc)
Esempio n. 2
0
    def request(self, flow: HTTPFlow):
        try:
            audit_logs.emit(
                audit_logs.VaultRequestAuditLogRecord(
                    flow_id=flow.id,
                    proxy_mode=ctx.get_proxy_context().mode,
                    method=flow.request.method,
                    uri=flow.request.url,
                ))
            flow.request_raw = flow.request.copy()
            content, match_details = self._process(
                flow=flow,
                phase=Phase.REQUEST,
                content=flow.request.content,
            )
            if match_details:
                flow.request.text = content
                flow.request.match_details = match_details

        except (RedactFailed, RevealFailed) as exc:
            logger.error(exc)

        except Exception as exc:
            logger.exception(exc)