Skip to content

Commit 4b33f91

Browse files
committed
Initialize token variable in A2AAuthMiddleware
Added explicit initialization of the 'token' variable to None in the _extract_token method to ensure it is always defined before use.
1 parent d9f8f62 commit 4b33f91

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

veadk/a2a/ve_middlewares.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ def _extract_token(self, request: Request) -> tuple[Optional[str], bool]:
206206
The extracted token, or None if not found
207207
"""
208208
has_prefix = False
209+
token = None
210+
209211
if self.auth_method == "header":
210212
# Extract from Authorization header
211213
auth_header = request.headers.get("Authorization") or request.headers.get(

0 commit comments

Comments
 (0)