Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
feat: Ability to limit request size and connection count #1481
This PR allows a
Example usage from Kitura is as follows:
let options = ServerOptions(requestSizeLimit: 100, connectionLimit: 3) Kitura.addHTTPServer(onPort: port, with: router, options: options)
If you do not specify either of the parameters, or do not specify a
If a client sends a request that exceeds the limit, then they are immediately sent an
These responses can be further customized by supplying
This does not provide a means to set a limit on the request headers (more specifically, all data up to the point where the HTTP parser determines that headers are complete). Both the HTTPParser in Kitura-net and Swift-NIO set a limit of 80kb on the size of the headers, and it seems unlikely in practice that this would need to be modified.
Some issues I'm aware of:
Motivation and Context
How Has This Been Tested?
Tests have been added for: