Skip to content

Commit

Permalink
fix: BasePathStrategy no longer breaks the strategy chain (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewTriesToCode authored Oct 12, 2024
1 parent f75ba2c commit 3263eff
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 3263eff

Please sign in to comment.