stefanprodan / WebApiThrottle

ASP.NET Web API rate limiter for IIS and Owin hosting
MIT License
1.28k stars 275 forks source link

set PesponsePolicy = true #79

Closed seven1276 closed 7 years ago

seven1276 commented 7 years ago

For example, when I set PesponsePolicy = true then It will response some infomattion to header like this: X-Rate-Limit-Quota:当前 AppKey 一个时间窗口内可调用次数 X-Rate-Limit-Remaining:当前时间窗口剩余的可用次数 X-Rate-Limit-Reset:距离时间窗口重置剩余的秒数

stefanprodan commented 7 years ago

There is no PesponsePolicy

seven1276 commented 7 years ago

I just think it could be usefull, some times... I wanna response remaining,quato,reset with every call, so that caller will know clearly

stefanprodan commented 7 years ago

This has been implemented here but it didn't make it into the master. The current implementation would make X-Rate very noise since there are multiple limits you can set and adding 3 headers per limit will pollute the response.