diff --git a/daemon_get.py b/daemon_get.py index fca24fcb0..0a67367c5 100644 --- a/daemon_get.py +++ b/daemon_get.py @@ -392,7 +392,7 @@ def daemon_http_get(self) -> None: referer_domain = _get_referer_domain(self, ua_str) mitm = detect_mitm(self) - if mitm: + if mitm and referer_domain: print('DEBUG: MITM on HTTP GET, ' + str(referer_domain)) curr_session, proxy_type = \ diff --git a/daemon_post.py b/daemon_post.py index 87f2dbccd..e99770ed6 100644 --- a/daemon_post.py +++ b/daemon_post.py @@ -41,6 +41,7 @@ from httpcodes import http_503 from httpheaders import contains_suspicious_headers from httpheaders import update_headers_catalog from httpheaders import redirect_headers +from daemon_utils import detect_mitm from daemon_utils import log_epicyon_instances from daemon_utils import get_user_agent from daemon_utils import post_to_outbox @@ -98,6 +99,10 @@ def daemon_http_post(self) -> None: self.server.headers_catalog, self.headers) + mitm = detect_mitm(self) + if mitm: + print('DEBUG: MITM on HTTP POST, ' + str(self.headers)) + # headers used by LLM scrapers if 'oai-host-hash' in self.headers: print('POST HTTP LLM scraper bounced: ' + str(self.headers))