f
This commit is contained in:
@@ -412,7 +412,7 @@ def normalize_urls(value: Any) -> List[str]:
|
||||
|
||||
return out
|
||||
|
||||
def _normalise_string_list(values: Optional[Iterable[Any]]) -> List[str]:
|
||||
def _normalize_string_list(values: Optional[Iterable[Any]]) -> List[str]:
|
||||
if not values:
|
||||
return []
|
||||
seen: Set[str] = set()
|
||||
@@ -769,7 +769,7 @@ def sync_sidecar(payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
else:
|
||||
sidecar_path = _derive_sidecar_path(candidate)
|
||||
|
||||
tags = _normalise_string_list(payload.get("tag"))
|
||||
tags = _normalize_string_list(payload.get("tag"))
|
||||
if not tags and sidecar_path.exists():
|
||||
tags = read_tags_from_file(sidecar_path)
|
||||
|
||||
|
||||
@@ -576,7 +576,7 @@ class UrlPolicy:
|
||||
return tags
|
||||
|
||||
|
||||
def _normalise_rule(rule: dict[str, Any]) -> dict[str, Any] | None:
|
||||
def _normalize_rule(rule: dict[str, Any]) -> dict[str, Any] | None:
|
||||
pattern = str(rule.get("pattern") or rule.get("host") or "").strip()
|
||||
if not pattern:
|
||||
return None
|
||||
@@ -614,7 +614,7 @@ def resolve_url_policy(config: dict[str, Any], url: str) -> UrlPolicy:
|
||||
for rule_raw in policies_raw:
|
||||
if not isinstance(rule_raw, dict):
|
||||
continue
|
||||
rule = _normalise_rule(rule_raw)
|
||||
rule = _normalize_rule(rule_raw)
|
||||
if rule is None:
|
||||
continue
|
||||
pattern = rule["pattern"]
|
||||
|
||||
Reference in New Issue
Block a user