From b36538a6b204f7af93cf6931e532216f04c75e30 Mon Sep 17 00:00:00 2001 From: Aaron Riekenberg Date: Mon, 22 Jul 2024 17:41:54 -0500 Subject: [PATCH] docs(server): update `Http1Builder::header_read_timeout` docs (#137) --- src/server/conn/auto.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/conn/auto.rs b/src/server/conn/auto.rs index c6668e9..1351a80 100644 --- a/src/server/conn/auto.rs +++ b/src/server/conn/auto.rs @@ -690,8 +690,13 @@ impl Http1Builder<'_, E> { /// Set a timeout for reading client request headers. If a client does not /// transmit the entire header within this time, the connection is closed. /// - /// Default is None. - pub fn header_read_timeout(&mut self, read_timeout: Duration) -> &mut Self { + /// Requires a [`Timer`] set by [`Http1Builder::timer`] to take effect. Panics if `header_read_timeout` is configured + /// without a [`Timer`]. + /// + /// Pass `None` to disable. + /// + /// Default is currently 30 seconds, but do not depend on that. + pub fn header_read_timeout(&mut self, read_timeout: impl Into>) -> &mut Self { self.inner.http1.header_read_timeout(read_timeout); self }