Comments (5)
how was with that?
from throttlingtroll.
This indeed would be a useful feature, @Mxater !
from throttlingtroll.
Working on it, @SebastianAviles . Expect a new release next week :)
from throttlingtroll.
Implemented and pushed this in form of a version 6.0.0-beta6.
Now your custom response fabric gets a List<LimitCheckResult> as a first parameter. That list contains results of checking all the matched rules. Rules that were exceeded will have LimitCheckResult.RequestsRemaining set to -1. LimitCheckResult also references the rule that was violated, so you can infer values for your custom headers from that rule's settings and produce those custom headers of your choice.
When a limit is not exceeded, you can get the same List<LimitCheckResult> from HttpContext.Items (or FunctionContext.Items) as shown here and then again produce custom headers of your choice.
Can you guys try this beta out and tell me if it works well for you?
from throttlingtroll.
Implemented in v6.0.
from throttlingtroll.
Related Issues (18)
- ArgumentOutOfRangeException "The absolute expiration value must be in the future." when using DistributedCacheCounterStore + Distributed Redis Cache HOT 1
- Support Functions ASP.NET Core Integration HOT 1
- Bug When 2 rules assigned to same identity or Endpoint. HOT 1
- Microsoft.AspNetCore.Http is deprecated, need to get rid of it HOT 1
- How to implement limit per identity? HOT 4
- [DistributedCacheCounterStore + Distributed Redis Cache] TTL is rounded to the nearest second, therefore setting interval to 1s does not make sense
- Default rule when using IdentityId HOT 4
- Issue with redis counter store HOT 2
- Implement declarative (attribute-based) configuration HOT 1
- Implement SQL counter store HOT 1
- Add ReleaseAfterSeconds property to Semaphore algorithm HOT 1
- [Optimization] Cache the fact that a particular limit is exceeded HOT 1
- Custom response builders HOT 1
- Port to Azure Functions (Isolated) HOT 1
- Make Rule's 'Method' property comma-separated HOT 1
- Allow specifying IdentityIdExtractor at ThrottlingTrollOptions level as well HOT 1
- Implement Azure Table/Cosmos DB counter store HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from throttlingtroll.