feat(server): add HTTP/1 header read timeout option (#2675)

Adds `Server::http1_header_read_timeout(Duration)`. Setting a duration will determine how long a client has to finish sending all the request headers before trigger a timeout test. This can help reduce resource usage when bad actors open connections without sending full requests.

Closes #2457
This commit is contained in:
Paolo Barbolini
2021-11-18 21:02:06 +01:00
committed by GitHub
parent d0b1d9ed3a
commit 842c6553a5
9 changed files with 308 additions and 3 deletions

View File

@@ -100,6 +100,7 @@ stream = []
runtime = [
"tcp",
"tokio/rt",
"tokio/time",
]
tcp = [
"socket2",