Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limitation isn't applied on specific endpoint #46

Closed
Vladimarinescu opened this issue Jun 29, 2018 · 4 comments
Closed

Limitation isn't applied on specific endpoint #46

Vladimarinescu opened this issue Jun 29, 2018 · 4 comments

Comments

@Vladimarinescu
Copy link

Vladimarinescu commented Jun 29, 2018

Hi Stefan,

This is my appsettings.json
"IpRateLimiting": { "EnableEndpointRateLimiting": true, "StackBlockedRequests": true, "RealIpHeader": "X-Real-IP", "ClientIdHeader": "X-ClientId", "HttpStatusCode": 429, //"IpWhitelist": [ "127.0.0.1", "::1/10", "192.168.0.0/24" ], //"EndpointWhitelist": [ "get:/api/license", "*:/api/status" ], //"ClientWhitelist": [ "dev-id-1", "dev-id-2" ], "GeneralRules": [ { "Endpoint": "*:api/account/ActivateUser", "Period": "20m", "Limit": 1 } ] }

And this is the route that i'm calling from my angular spa
http://localhost:59323/api/account/ActivateUser

The limitation isn't applied. On the other side, if i'm using : "Endpoint": "*", everything works O.K

Any idea? Thanks

@Vladimarinescu
Copy link
Author

Also, if i use */account/ActivateUser works, why?

@Ueterbock
Copy link

I´ve got the exact same scenario and also tried several endpoint definitions for my route /api/test:
{ "Endpoint": "get:/api/test", "Period": "1h", "Limit": 20 }, { "Endpoint": "*:/api/test", "Period": "1h", "Limit": 20 }, { "Endpoint": "*:/api/Test", "Period": "1h", "Limit": 20 }, { "Endpoint": "get:/api/Test", "Period": "1h", "Limit": 20 }, { "Endpoint": "*api/Test", "Period": "1h", "Limit": 20 }, { "Endpoint": "*api/test", "Period": "1h", "Limit": 20 }, { "Endpoint": "*/Test", "Period": "1h", "Limit": 20 }, { "Endpoint": "*/test", "Period": "1h", "Limit": 20 }

It will only work if the endpoint is defined with an asterisk.

@RaddadZ
Copy link

RaddadZ commented Sep 16, 2018

i think if your url is http://localhost:59323/api/account/ActivateUser then your endpoint should be

{ 
   "Endpoint": "*:/api/account/ActivateUser", 
   "Period": "20m", 
   "Limit": 1 
}

@cristipufu
Copy link
Collaborator

The Wildcard match issues are fixed here: #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants