Skip to content

Commit

Permalink
rename block function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenifer Tabita Ciuciu-Kiss committed Oct 16, 2024
1 parent abeebc8 commit a1c47cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ontologytimemachine/custom_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ontologytimemachine/utils/proxy_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_proxy_logic.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit a1c47cf

Please sign in to comment.