summaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/addon.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/proxy/addon.py')
-rw-r--r--src/hydrilla/proxy/addon.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/hydrilla/proxy/addon.py b/src/hydrilla/proxy/addon.py
index c7fae7e..b9c4159 100644
--- a/src/hydrilla/proxy/addon.py
+++ b/src/hydrilla/proxy/addon.py
@@ -40,6 +40,7 @@ import traceback as tb
from threading import Lock
from pathlib import Path
from contextlib import contextmanager
+from urllib.parse import urlparse
from mitmproxy import tls, http, addonmanager, ctx
from mitmproxy.script import concurrent
@@ -184,6 +185,14 @@ class HaketiloAddon:
available at this point, so the handler effectively does nothing.
"""
with self.http_safe_event_handling(flow):
+ referrer = flow.request.headers.get('referer')
+ if referrer is not None:
+ if urlparse(referrer).netloc == 'hkt.mitm.it' and \
+ urlparse(flow.request.url).netloc != 'hkt.mitm.it':
+ # Do not reveal to the site that Haketilo meta-site was
+ # visited before.
+ flow.request.headers.pop('referer', None)
+
policy = self.try_get_policy(flow)
if policy is not None: