From 683cc9bc7ec6fbd5bb1dfedbf460a7419f54ba1b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 16 Dec 2024 12:45:18 +0000 Subject: [PATCH] Convert to string --- daemon_utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/daemon_utils.py b/daemon_utils.py index 94fb4ba4e..09dfa8e87 100644 --- a/daemon_utils.py +++ b/daemon_utils.py @@ -218,11 +218,12 @@ def _detect_mitm(self) -> bool: ) for interloper in mitm_domains: for header_name in check_headers: - if self.headers.get(header_name): - if interloper in self.headers[header_name]: - print('MITM: ' + header_name + ' = ' + - self.headers[header_name]) - return True + if not self.headers.get(header_name): + continue + if interloper in str(self.headers[header_name]): + print('MITM: ' + header_name + ' = ' + + str(self.headers[header_name])) + return True # The presence of these headers on their own indicates a MiTM mitm_headers = ( 'CF-Connecting-IP', 'CF-RAY', 'CF-IPCountry', 'CF-Visitor',