diff --git a/src/Middleware/RequestThrottling/src/RequestThrottlingMiddleware.cs b/src/Middleware/RequestThrottling/src/RequestThrottlingMiddleware.cs index 4aa7e9c9be..7af7e0603c 100644 --- a/src/Middleware/RequestThrottling/src/RequestThrottlingMiddleware.cs +++ b/src/Middleware/RequestThrottling/src/RequestThrottlingMiddleware.cs @@ -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));