From 60e6dd0a1a95945c15b33f7f3a2b6e6d6473ae0f Mon Sep 17 00:00:00 2001 From: Alexander Myasoedov Date: Thu, 20 Feb 2025 23:31:06 +0200 Subject: [PATCH] fix(empty value in secret expansion): --- agentic_security/http_spec.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agentic_security/http_spec.py b/agentic_security/http_spec.py index cccf228..37bd580 100644 --- a/agentic_security/http_spec.py +++ b/agentic_security/http_spec.py @@ -27,8 +27,7 @@ def encode_audio_base64_by_url(url: str) -> str: return "data:audio/mpeg;base64," + encoded_content -class InvalidHTTPSpecError(Exception): - ... +class InvalidHTTPSpecError(Exception): ... class LLMSpec(BaseModel): @@ -169,6 +168,8 @@ def parse_http_spec(http_spec: str) -> LLMSpec: has_audio = "<>" in body for key, value in secrets.items(): + if not value: + continue key = key.strip("$") body = body.replace(f"${key}", value)