Skip to content

Commit 8bf26d1

Browse files
committedNov 8, 2023
feat(server): default http1 header_read_timeout to 30 seconds
1 parent f3308c0 commit 8bf26d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/server/conn/http1.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl Builder {
240240
h1_keep_alive: true,
241241
h1_title_case_headers: false,
242242
h1_preserve_header_case: false,
243-
h1_header_read_timeout: Dur::Default(None),
243+
h1_header_read_timeout: Dur::Default(Some(Duration::from_secs(30))),
244244
h1_writev: None,
245245
max_buf_size: None,
246246
pipeline_flush: false,
@@ -295,7 +295,9 @@ impl Builder {
295295
/// Set a timeout for reading client request headers. If a client does not
296296
/// transmit the entire header within this time, the connection is closed.
297297
///
298-
/// Default is None.
298+
/// Pass `None` to disable.
299+
///
300+
/// Default is 30 seconds.
299301
pub fn header_read_timeout(&mut self, read_timeout: impl Into<Option<Duration>>) -> &mut Self {
300302
self.h1_header_read_timeout = Dur::Configured(read_timeout.into());
301303
self

0 commit comments

Comments
 (0)
Please sign in to comment.