Skip to content

Commit

Permalink
Hotfix get tenant from headers directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
PremyslCerny committed Nov 20, 2024
1 parent fb69e06 commit 7e9f596
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asab/web/auth/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def _set_tenant_context_from_url_query(handler):
@functools.wraps(handler)
async def wrapper(*args, **kwargs):
request = args[-1]
header_tenant = Tenant.get(None)
header_tenant = request.headers.get("X-Tenant")
tenant = request.query.get("tenant")

if tenant is None:
Expand Down Expand Up @@ -797,7 +797,7 @@ def _set_tenant_context_from_url_path(handler):
@functools.wraps(handler)
async def wrapper(*args, **kwargs):
request = args[-1]
header_tenant = Tenant.get(None)
header_tenant = request.headers.get("X-Tenant")
tenant = request.match_info.get("tenant")

if header_tenant is not None:
Expand Down

0 comments on commit 7e9f596

Please sign in to comment.