AspNetCoreRateLimit icon indicating copy to clipboard operation
AspNetCoreRateLimit copied to clipboard

Is there a way to do wildcard matching in Endpoint

Open anshuman29 opened this issue 3 years ago • 2 comments

Hello Currently I am using the following, this would match all endpoints starting with /workspaces. "GeneralRules": [ { "Endpoint": ":/workspaces/", "Period": "30s", "Limit": 10 } ]

I would like a way to set different throttling limits on different endpoints, something like this: "GeneralRules": [ { "Endpoint": ":/workspaces/{workspaceId}/alerts/{alertId}", "Period": "30s", "Limit": 10 }, { "Endpoint": ":/workspaces/{workspaceId}/analysis/{analysisId}", "Period": "30s", "Limit": 20 }, { "Endpoint": ":", "Period": "30s", "Limit": 50 } ]

Is there a way to do this?

anshuman29 avatar Jul 23 '21 18:07 anshuman29

just replace {workspaceId} by * ex : Endpoint": "*:/workspaces/{workspaceId}/alerts/{alertId}", becomes Endpoint": "*:/workspaces/*/alerts/*",

RaynaldM avatar Aug 17 '21 09:08 RaynaldM

I have similar requirement as well, where I need to match on subset of request path: e.g. /odata/mnt/asset I would like set Endpoint to "/odata/".

I tried few options: Endpoint: ":/odata/" Endpont: "/odata/" Endpont: "/odata/*"

but none of these worked. Any ideas?

Thanks in advance Dan

danleydmello avatar Nov 23 '21 22:11 danleydmello