Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,9 @@ def get_principal_from_context(
don't reliably propagate to async callers (Python ContextVar + async/sync boundary issue).
The caller MUST call set_current_tenant(tenant_context) in their own context.
"""
if not context:
return (None, None)

# Get headers using the recommended FastMCP approach
# NOTE: get_http_headers() works via context vars, so it can work even when context=None
# This allows unauthenticated public discovery endpoints to detect tenant from headers
# CRITICAL: Use include_all=True to get Host header (excluded by default)
headers = None
try:
Expand Down