Ensure MaxConcurrentRequests is a positive number (#11003)

This commit is contained in:
Kahbazi 2019-06-08 03:12:09 +04:30 committed by Dylan Dmitri Gray
parent 3259a2c9f6
commit d3d6e0e709
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@ namespace Microsoft.AspNetCore.RequestThrottling
{
throw new ArgumentException("The value of 'options.MaxConcurrentRequests' must be specified.", nameof(options));
}
if (_requestThrottlingOptions.MaxConcurrentRequests < 0)
{
throw new ArgumentException("The value of 'options.MaxConcurrentRequests' must be a positive integer.", nameof(options));
}
if (_requestThrottlingOptions.RequestQueueLimit < 0)
{
throw new ArgumentException("The value of 'options.RequestQueueLimit' must be a positive integer.", nameof(options));