Skip to content

Commit

Permalink
manual backport of opensearch-project#1024
Browse files Browse the repository at this point in the history
Signed-off-by: Rutuja Surve <[email protected]>
  • Loading branch information
rutuja-amazon committed Aug 10, 2022
1 parent aea366f commit c6fb0ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/multitenancy/tenant_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ export function resolveTenant(
): string | undefined {
let selectedTenant: string | undefined;
const query: any = request.url.query as any;
// eslint-disable-next-line @typescript-eslint/naming-convention
const security_tenant = request?.url?.searchParams?.get('security_tenant');
if (query && (query.security_tenant || query.securitytenant)) {
selectedTenant = query.security_tenant ? query.security_tenant : query.securitytenant;
} else if (security_tenant) {
selectedTenant = security_tenant;
} else if (request.headers.securitytenant || request.headers.security_tenant) {
selectedTenant = request.headers.securitytenant
? (request.headers.securitytenant as string)
Expand Down

0 comments on commit c6fb0ed

Please sign in to comment.