Skip to content

Commit 3263eff

Browse files
authoredOct 12, 2024··
fix: BasePathStrategy no longer breaks the strategy chain (#884)
1 parent f75ba2c commit 3263eff

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎src/Finbuckle.MultiTenant.AspNetCore/Extensions/MultiTenantBuilderExtensions.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,8 @@ public static MultiTenantBuilder<TTenantInfo> WithBasePathStrategy<TTenantInfo>(
220220
var origOnTenantResolved = options.Events.OnTenantResolved;
221221
options.Events.OnTenantResolved = tenantResolvedContext =>
222222
{
223-
var httpContext = tenantResolvedContext.Context as HttpContext ??
224-
throw new MultiTenantException("BasePathStrategy expects HttpContext.");
225-
226223
if (tenantResolvedContext.StrategyType == typeof(BasePathStrategy) &&
224+
tenantResolvedContext.Context is HttpContext httpContext &&
227225
httpContext.RequestServices.GetRequiredService<IOptions<BasePathStrategyOptions>>().Value
228226
.RebaseAspNetCorePathBase)
229227
{

0 commit comments

Comments
 (0)