Skip to content

Commit

Permalink
fix: BasePathStrategy no longer breaks the strategy chain
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewTriesToCode committed Oct 12, 2024
1 parent f75ba2c commit da00083
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,8 @@ public static MultiTenantBuilder<TTenantInfo> WithBasePathStrategy<TTenantInfo>(
var origOnTenantResolved = options.Events.OnTenantResolved;
options.Events.OnTenantResolved = tenantResolvedContext =>
{
var httpContext = tenantResolvedContext.Context as HttpContext ??
throw new MultiTenantException("BasePathStrategy expects HttpContext.");

if (tenantResolvedContext.StrategyType == typeof(BasePathStrategy) &&
tenantResolvedContext.Context is HttpContext httpContext &&
httpContext.RequestServices.GetRequiredService<IOptions<BasePathStrategyOptions>>().Value
.RebaseAspNetCorePathBase)
{
Expand Down

0 comments on commit da00083

Please sign in to comment.