Skip to content

Commit

Permalink
Get security_tenant search param from URL (#1024) (#1026)
Browse files Browse the repository at this point in the history
Signed-off-by: cliu123 <[email protected]>
(cherry picked from commit 348c550)

Co-authored-by: Chang Liu <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and cliu123 authored Jul 7, 2022
1 parent ee617d6 commit 4a4416d
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 @@ -46,10 +46,14 @@ export function resolveTenant(
let selectedTenant: string | undefined;
const securityTenant_ = request?.url?.searchParams?.get('securityTenant_');
const securitytenant = request?.url?.searchParams?.get('securitytenant');
// eslint-disable-next-line @typescript-eslint/naming-convention
const security_tenant = request?.url?.searchParams?.get('security_tenant');
if (securityTenant_) {
selectedTenant = securityTenant_;
} else if (securitytenant) {
selectedTenant = securitytenant;
} else if (security_tenant) {
selectedTenant = security_tenant;
} else if (request.headers.securitytenant || request.headers.securityTenant_) {
selectedTenant = request.headers.securitytenant
? (request.headers.securitytenant as string)
Expand Down

0 comments on commit 4a4416d

Please sign in to comment.