fix: refine security validation messaging
Agent-Logs-Url: https://github.com/MemPalace/mempalace/sessions/775f2fc4-3051-462e-8586-6d694b55da0d Co-authored-by: igorls <4753812+igorls@users.noreply.github.com>
This commit is contained in:
committed by
Igor Lins e Silva
parent
248ecd98f1
commit
976289aa5c
@@ -69,11 +69,11 @@ def sanitize_query(raw_query: str) -> dict:
|
||||
|
||||
def _strip_wrapping_quotes(candidate: str) -> str:
|
||||
candidate = candidate.strip()
|
||||
while candidate[:1] in {"'", '"'} or candidate[-1:] in {"'", '"'}:
|
||||
while candidate[:1] in {"'", '"'} and candidate[-1:] in {"'", '"'}:
|
||||
candidate = candidate.strip("\"'")
|
||||
if not candidate:
|
||||
return ""
|
||||
return candidate
|
||||
return candidate.strip("\"'")
|
||||
|
||||
def _trim_candidate(candidate: str) -> str:
|
||||
candidate = _strip_wrapping_quotes(candidate)
|
||||
|
||||
Reference in New Issue
Block a user