From a1c47cf2cda135cb9ab4cc0ebb4c0f95b9ed95b7 Mon Sep 17 00:00:00 2001 From: Jenifer Tabita Ciuciu-Kiss Date: Wed, 16 Oct 2024 23:55:18 +0200 Subject: [PATCH] rename block function --- ontologytimemachine/custom_proxy.py | 4 ++-- ontologytimemachine/utils/proxy_logic.py | 2 +- tests/test_proxy_logic.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ontologytimemachine/custom_proxy.py b/ontologytimemachine/custom_proxy.py index 9d07327..f147b60 100644 --- a/ontologytimemachine/custom_proxy.py +++ b/ontologytimemachine/custom_proxy.py @@ -5,7 +5,7 @@ from ontologytimemachine.proxy_wrapper import HttpRequestWrapper from ontologytimemachine.utils.proxy_logic import ( get_response_from_request, - if_intercept_host, + if_not_block_host, is_archivo_ontology_request, ) from ontologytimemachine.utils.config import Config, parse_arguments @@ -44,7 +44,7 @@ def before_upstream_connection(self, request: HttpParser) -> HttpParser | None: logger.info(f"HTTPS interception mode: {self.config.httpsInterception}") # Only intercept if interception is enabled - if if_intercept_host(self.config): + if if_not_block_host(self.config): logger.info("HTTPS interception is on, forwardig the request") return request else: diff --git a/ontologytimemachine/utils/proxy_logic.py b/ontologytimemachine/utils/proxy_logic.py index 3fc3eb3..77655d5 100644 --- a/ontologytimemachine/utils/proxy_logic.py +++ b/ontologytimemachine/utils/proxy_logic.py @@ -24,7 +24,7 @@ logger = logging.getLogger(__name__) -def if_intercept_host(config): +def if_not_block_host(config): if config.httpsInterception in ["none", "all"]: return True elif config.httpsInterception in ["block"]: diff --git a/tests/test_proxy_logic.py b/tests/test_proxy_logic.py index 07bc93e..473e4bd 100644 --- a/tests/test_proxy_logic.py +++ b/tests/test_proxy_logic.py @@ -1,6 +1,6 @@ import unittest from ontologytimemachine.utils.proxy_logic import ( - if_intercept_host, + if_not_block_host, do_deny_request_due_non_archivo_ontology_uri, load_archivo_urls, is_archivo_ontology_request,