ejcoyle88/KnowYourLimits

The middleware refuses to recognise that the strategy is being passed in as an argument and not via DI

Closed this issue · 0 comments

When calling UseRateLimiting and passing in the strategy to use, internally this calling UseMiddleware<RateLimiterMiddleware<TClientIdentity>>(rateLimitStrategy);.

For some reason, dispite the documentation saying this should work the framework refuses to use the passed in object and instead tries to load it from DI, which immediately blows up.

I don't want people to have to setup their strategy in DI seperately, because that seems a bit rubbish, but it does seem to be a pattern that is used by IdentityServer and stuff.