stefanprodan / WebApiThrottle

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

When http request size is large, HttpContext.Current is null #142

Open ashokpatel24 opened 3 years ago

ashokpatel24 commented 3 years ago

When request size is too large eg. 8MB then it fails with object reference error

{ "Message": "An error has occurred.", "ExceptionMessage": "Object reference not set to an instance of an object.", "ExceptionType": "System.NullReferenceException", "StackTrace": " at WebApiThrottle.CacheRepository.FirstOrDefault(String id)\r\n at WebApiThrottle.ThrottlingCore.ProcessRequest(TimeSpan timeSpan, String id)\r\n at WebApiThrottle.ThrottlingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at