Skip to content

Commit 22c3056

Browse files
committed
addressed coderabbit
1 parent 965f490 commit 22c3056

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/utils/mcp_oauth_probe.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ async def check_mcp_auth(configuration: AppConfig, mcp_headers: McpHeaders) -> N
4242
probes = []
4343
for mcp_server in configuration.mcp_servers:
4444
headers = mcp_headers.get(mcp_server.name, {})
45-
if headers.get("Authorization", None):
46-
authorization = f"Bearer {headers.get("Authorization", None)}"
45+
auth_header = headers.get("Authorization")
46+
if auth_header:
47+
authorization = (
48+
auth_header
49+
if auth_header.startswith("Bearer ")
50+
else f"Bearer {auth_header}"
51+
)
4752
else:
4853
authorization = None
4954

0 commit comments

Comments
 (0)