Skip to content

Commit 618a442

Browse files
p-Copilot
andauthored
Update src/seclab_taskflow_agent/capi.py
Co-authored-by: Copilot <[email protected]>
1 parent b4cff10 commit 618a442

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/seclab_taskflow_agent/capi.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ def get_custom_header() -> dict[str, str]:
6767
return {}
6868

6969
name, value = parts
70-
return {name.strip(): value.strip()}
70+
name = name.strip()
71+
value = value.strip()
72+
if not name or not value:
73+
logging.warning(f"Invalid AI_API_CUSTOM_HEADER: header name and value must be non-empty after stripping. Got: '{custom_header}'")
74+
return {}
75+
return {name: value}
7176

7277

7378
# assume we are >= python 3.9 for our type hints

0 commit comments

Comments
 (0)