Skip to content

Commit 43c574e

Browse files
author
Suresh Kumar Moharajan
committed
fix: guard captured regex thread exceptions
Signed-off-by: Suresh Kumar Moharajan <suresh.kumar.m@ibm.com>
1 parent 59bcf71 commit 43c574e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mcpgateway/services/content_security.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,9 @@ def search_thread():
343343
)
344344
raise TimeoutError(f"Regex search exceeded {timeout}s timeout - possible ReDoS attack")
345345

346-
if exception[0]:
347-
raise exception[0]
346+
captured_exception = exception[0]
347+
if captured_exception is not None:
348+
raise captured_exception
348349

349350
return result[0]
350351

0 commit comments

Comments
 (0)