Skip to content

Commit b36538a

Browse files
docs(server): update Http1Builder::header_read_timeout docs (#137)
1 parent efd57ff commit b36538a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/server/conn/auto.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,13 @@ impl<E> Http1Builder<'_, E> {
690690
/// Set a timeout for reading client request headers. If a client does not
691691
/// transmit the entire header within this time, the connection is closed.
692692
///
693-
/// Default is None.
694-
pub fn header_read_timeout(&mut self, read_timeout: Duration) -> &mut Self {
693+
/// Requires a [`Timer`] set by [`Http1Builder::timer`] to take effect. Panics if `header_read_timeout` is configured
694+
/// without a [`Timer`].
695+
///
696+
/// Pass `None` to disable.
697+
///
698+
/// Default is currently 30 seconds, but do not depend on that.
699+
pub fn header_read_timeout(&mut self, read_timeout: impl Into<Option<Duration>>) -> &mut Self {
695700
self.inner.http1.header_read_timeout(read_timeout);
696701
self
697702
}

0 commit comments

Comments
 (0)