debug cleanup

This commit is contained in:
2025-12-26 03:26:33 +01:00
parent afdd3a34b3
commit 499a3cb170

View File

@@ -35,18 +35,12 @@ mcp = FastMCP("Cavepedia MCP")
def get_user_roles() -> list[str]: def get_user_roles() -> list[str]:
"""Extract user roles from the X-User-Roles header.""" """Extract user roles from the X-User-Roles header."""
headers = get_http_headers() headers = get_http_headers()
print(f"DEBUG: All headers received: {dict(headers)}")
roles_header = headers.get("x-user-roles", "") roles_header = headers.get("x-user-roles", "")
print(f"DEBUG: x-user-roles header value: '{roles_header}'")
if roles_header: if roles_header:
try: try:
roles = json.loads(roles_header) return json.loads(roles_header)
print(f"DEBUG: Parsed roles: {roles}") except json.JSONDecodeError:
return roles
except json.JSONDecodeError as e:
print(f"DEBUG: JSON decode error: {e}")
return [] return []
print("DEBUG: No roles header found, returning empty list")
return [] return []
def is_sources_only() -> bool: def is_sources_only() -> bool: