Comments (7)
+1 to this. I have set the "path_limits" in the config file to my root API path but it seems to have no effect.
I don't want to have to specify this on every controller. Is this the intended action? If so, why require the path limits config?
from ratelimitbundle.
This issue can be closed as it seems like #119
New usage:
path_limits:
- { path: *, method: *, limit: 1000, period: 3600 }
from ratelimitbundle.
This issue is pretty old now. Has anyone fond a way to achieve a global rate limit?
from ratelimitbundle.
path_limits:
- { path: /, limit: 1000, period: 3600 }
from ratelimitbundle.
You have the full config list at https://github.com/jaytaph/RateLimitBundle#configuration-reference
from ratelimitbundle.
from ratelimitbundle.
Hi, I am trying to use pesseyjulien's solution above for global limit for all routes. Once the path config contains something more than '/'
, the PathLimitProcessor
compares it by parts in pathMatched()
method and it works fine as prefix. However, when the path is just '/'
, it gets trimmed in constructor to an empty string and then pathMatched()
compares ''
to any string present in URL, which is false - except the homepage path itself. The same can be seen watching http headers - they are present only for '/'
route and no other/longer path. Should there be some more test for this scenario inside pathMatched()
like
if (count($expectedParts) == 1 && $expectedParts[0] == '') { return true; }
?
Then also the constructor needs to be updated - to sort ''
lower than 'xyz'
paths even they have the same substr_count()
, current code keeps the original sort from config file.
Tested on "version": "1.15.1"
from ratelimitbundle.
Related Issues (20)
- Remove composer.lock file HOT 3
- Symfony cache support? HOT 6
- configuration by path with path_limits is not working HOT 5
- [question] Multiple simultaneate ratelimits of different periods per route
- must be an instance of Predis\\Client, instance of Redis given HOT 2
- Invalid Test Namespaces HOT 3
- [Bug] RateLimitBundle will not autoload anymore in Composer v2.0 HOT 9
- Move from travis to github actions HOT 1
- Cache key contains reserved characters aka IPv6 support HOT 9
- update dependency sensio/framework-extra-bundle 6.* HOT 3
- Allow wildcard in path for path_limit HOT 2
- Relation/comparison with rate-limiter
- Renaming master to main branch
- How to overwrite limit specific group or domain or client? HOT 1
- Addition of fail open HOT 1
- Support new `EventDispatcherInterface` HOT 3
- FilterControllerEvent deprecated in Symfony 4.3 HOT 1
- Creating custom exception class for RateLimitException Handling
- symfony recipe
- Update readme documentation
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 ratelimitbundle.