diff --git a/app/core/xray.py b/app/core/xray.py index b626420bf..02745d612 100644 --- a/app/core/xray.py +++ b/app/core/xray.py @@ -14,11 +14,13 @@ class XRayConfig(dict): def __init__( self, - config: Union[dict, str, PosixPath] = {}, - exclude_inbound_tags: set[str] | None = set(), - fallbacks_inbound_tags: set[str] | None = set(), + config: Union[dict, str, PosixPath] | None = None, + exclude_inbound_tags: set[str] | None = None, + fallbacks_inbound_tags: set[str] | None = None, ): """Initialize the XRay config.""" + if config is None: + config = {} if isinstance(config, str): # considering string as json config = commentjson.loads(config) diff --git a/app/utils/logger.py b/app/utils/logger.py index f81cc0fee..87d858656 100644 --- a/app/utils/logger.py +++ b/app/utils/logger.py @@ -1,4 +1,5 @@ import logging +import logging.config from copy import copy from urllib.parse import unquote @@ -88,7 +89,7 @@ def __init__(self, excluded_endpoints: list[str]): self.excluded_endpoints = excluded_endpoints def filter(self, record: logging.LogRecord) -> bool: - if record.args and len(record.args) >= 2: + if record.args and len(record.args) >= 3: path = unquote(record.args[2]) return path not in self.excluded_endpoints return True