From f008bf38274698b915f14ccc0cc34c9b56dd0d6e Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Mon, 14 Apr 2025 16:46:44 -0400 Subject: [PATCH 1/8] feat: add server configuration --- apollo-router/src/configuration/server.rs | 140 ++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 apollo-router/src/configuration/server.rs diff --git a/apollo-router/src/configuration/server.rs b/apollo-router/src/configuration/server.rs new file mode 100644 index 0000000000..010e85ec01 --- /dev/null +++ b/apollo-router/src/configuration/server.rs @@ -0,0 +1,140 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use std::time::Duration; + +const DEFAULT_HEADER_READ_TIMEOUT: Duration = Duration::from_secs(10); + +fn default_header_read_timeout() -> Duration { + DEFAULT_HEADER_READ_TIMEOUT +} + +/// Configuration for HTTP +#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)] +#[serde(deny_unknown_fields, default)] +pub(crate) struct ServerHttpConfig { + /// Header read timeout in human-readable format; defaults to 10s + #[serde( + deserialize_with = "humantime_serde::deserialize", + default = "default_header_read_timeout" + )] + #[schemars(with = "String", default = "default_header_read_timeout")] + pub(crate) header_read_timeout: Duration, +} + +#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)] +#[serde(deny_unknown_fields, default)] +pub(crate) struct Server { + /// The server http configuration + pub(crate) http: ServerHttpConfig, +} + +impl Default for ServerHttpConfig { + fn default() -> Self { + Self { + header_read_timeout: Duration::from_secs(10), + } + } +} + +#[buildstructor::buildstructor] +impl ServerHttpConfig { + #[builder] + pub(crate) fn new(header_read_timeout: Option) -> Self { + Self { + header_read_timeout: header_read_timeout.unwrap_or_default(), + } + } +} + +#[buildstructor::buildstructor] +impl Server { + #[builder] + pub(crate) fn new(http: Option) -> Self { + Self { + http: http.unwrap_or_default(), + } + } +} + +impl Default for Server { + fn default() -> Self { + Self::builder().build() + } +} + +#[cfg(test)] +mod tests { + use serde_json::json; + use super::*; + + #[test] + fn it_builds_default_server_configuration() { + let default_duration_seconds = Duration::from_secs(10); + let server_config = Server::builder().build(); + assert_eq!( + server_config.http.header_read_timeout, + default_duration_seconds + ); + } + + #[test] + fn it_builds_custom_server_configuration() { + let duration_seconds = Duration::from_secs(30); + let http_config = ServerHttpConfig::builder() + .header_read_timeout(duration_seconds) + .build(); + let server_config = Server::builder() + .http(http_config) + .build(); + assert_eq!( + server_config.http.header_read_timeout, + duration_seconds + ); + } + + #[test] + fn it_json_parses_default_header_read_timeout_when_server_http_config_omitted() { + let json_server = json!({}); + + let config: Server = serde_json::from_value(json_server).unwrap(); + + assert_eq!(config.http.header_read_timeout, Duration::from_secs(10)); + } + + #[test] + fn it_json_parses_default_header_read_timeout_when_omitted() { + let json_config = json!({ + "http": {} + }); + + let config: Server = serde_json::from_value(json_config).unwrap(); + + assert_eq!(config.http.header_read_timeout, Duration::from_secs(10)); + } + + #[test] + fn it_json_parses_specified_server_config_seconds_correctly() { + let json_config = json!({ + "http": { + "header_read_timeout": "30s" + } + }); + + let config: Server = serde_json::from_value(json_config).unwrap(); + + assert_eq!(config.http.header_read_timeout, Duration::from_secs(30)); + } + + #[test] + fn it_json_parses_specified_server_config_minutes_correctly() { + let json_config = json!({ + "http": { + "header_read_timeout": "1m" + } + }); + + let config: Server = serde_json::from_value(json_config).unwrap(); + + assert_eq!(config.http.header_read_timeout, Duration::from_secs(60)); + } +} From 8683f3a674b06bf1ddfb1210927fcdb5f271749a Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Mon, 14 Apr 2025 16:47:16 -0400 Subject: [PATCH 2/8] feat: add server configuration to router config --- apollo-router/src/configuration/mod.rs | 12 ++++++++++++ apollo-router/src/configuration/tests.rs | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/apollo-router/src/configuration/mod.rs b/apollo-router/src/configuration/mod.rs index b768442667..ccf7d6d462 100644 --- a/apollo-router/src/configuration/mod.rs +++ b/apollo-router/src/configuration/mod.rs @@ -45,6 +45,7 @@ pub(crate) use self::experimental::Discussed; pub(crate) use self::schema::generate_config_schema; pub(crate) use self::schema::generate_upgrade; pub(crate) use self::schema::validate_yaml_configuration; +use self::server::Server; use self::subgraph::SubgraphConfiguration; use crate::ApolloRouterError; use crate::cache::DEFAULT_CACHE_CAPACITY; @@ -67,6 +68,7 @@ mod experimental; pub(crate) mod metrics; mod persisted_queries; pub(crate) mod schema; +pub(crate) mod server; pub(crate) mod shared; pub(crate) mod subgraph; #[cfg(test)] @@ -155,6 +157,10 @@ pub struct Configuration { #[serde(default)] pub(crate) homepage: Homepage, + /// Configuration for the server + #[serde(default)] + pub(crate) server: Server, + /// Configuration for the supergraph #[serde(default)] pub(crate) supergraph: Supergraph, @@ -227,6 +233,7 @@ impl<'de> serde::Deserialize<'de> for Configuration { health_check: HealthCheck, sandbox: Sandbox, homepage: Homepage, + server: Server, supergraph: Supergraph, cors: Cors, plugins: UserPlugins, @@ -261,6 +268,7 @@ impl<'de> serde::Deserialize<'de> for Configuration { health_check: ad_hoc.health_check, sandbox: ad_hoc.sandbox, homepage: ad_hoc.homepage, + server: ad_hoc.server, supergraph: ad_hoc.supergraph, cors: ad_hoc.cors, tls: ad_hoc.tls, @@ -309,12 +317,14 @@ impl Configuration { uplink: Option, experimental_type_conditioned_fetching: Option, batching: Option, + server: Option, ) -> Result { let notify = Self::notify(&apollo_plugins)?; let conf = Self { validated_yaml: Default::default(), supergraph: supergraph.unwrap_or_default(), + server: server.unwrap_or_default(), health_check: health_check.unwrap_or_default(), sandbox: sandbox.unwrap_or_default(), homepage: homepage.unwrap_or_default(), @@ -444,9 +454,11 @@ impl Configuration { uplink: Option, batching: Option, experimental_type_conditioned_fetching: Option, + server: Option, ) -> Result { let configuration = Self { validated_yaml: Default::default(), + server: server.unwrap_or_default(), supergraph: supergraph.unwrap_or_else(|| Supergraph::fake_builder().build()), health_check: health_check.unwrap_or_else(|| HealthCheck::builder().build()), sandbox: sandbox.unwrap_or_else(|| Sandbox::fake_builder().build()), diff --git a/apollo-router/src/configuration/tests.rs b/apollo-router/src/configuration/tests.rs index 1a5c804498..53dda5e3e0 100644 --- a/apollo-router/src/configuration/tests.rs +++ b/apollo-router/src/configuration/tests.rs @@ -1169,6 +1169,30 @@ fn it_processes_specified_maximum_batch_limit_correctly() { assert_eq!(config.maximum_size, Some(10)); } +#[test] +fn it_includes_default_header_read_timeout_when_server_config_omitted() { + let json_config = json!({}); + + let config: Configuration = serde_json::from_value(json_config).unwrap(); + + assert_eq!(config.server.http.header_read_timeout, Duration::from_secs(10)); +} + +#[test] +fn it_processes_specified_server_config_correctly() { + let json_config = json!({ + "server": { + "http": { + "header_read_timeout": "30s" + } + } + }); + + let config: Configuration = serde_json::from_value(json_config).unwrap(); + + assert_eq!(config.server.http.header_read_timeout, Duration::from_secs(30)); +} + fn has_field_level_serde_defaults(lines: &[&str], line_number: usize) -> bool { let serde_field_default = Regex::new( r#"^\s*#[\s\n]*\[serde\s*\((.*,)?\s*default\s*=\s*"[a-zA-Z0-9_:]+"\s*(,.*)?\)\s*\]\s*$"#, From bca998b2edf37a54cef51d7af07bdadc9af0456c Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Mon, 14 Apr 2025 16:47:46 -0400 Subject: [PATCH 3/8] feat: use server header_read_timeout when creating http_connection --- apollo-router/src/axum_factory/axum_http_server_factory.rs | 4 +++- apollo-router/src/axum_factory/listeners.rs | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apollo-router/src/axum_factory/axum_http_server_factory.rs b/apollo-router/src/axum_factory/axum_http_server_factory.rs index 6f707e6d11..bd2cccda03 100644 --- a/apollo-router/src/axum_factory/axum_http_server_factory.rs +++ b/apollo-router/src/axum_factory/axum_http_server_factory.rs @@ -4,7 +4,7 @@ use std::pin::Pin; use std::sync::Arc; use std::sync::atomic::AtomicU64; use std::sync::atomic::Ordering; -use std::time::Instant; +use std::time::{Duration, Instant}; use axum::Router; use axum::extract::Extension; @@ -226,6 +226,7 @@ impl HttpServerFactory for AxumHttpServerFactory { all_routers.main.1, configuration.limits.http1_max_request_headers, configuration.limits.http1_max_request_buf_size, + configuration.server.http.header_read_timeout, all_connections_stopped_sender.clone(), ); @@ -268,6 +269,7 @@ impl HttpServerFactory for AxumHttpServerFactory { router, configuration.limits.http1_max_request_headers, configuration.limits.http1_max_request_buf_size, + configuration.server.http.header_read_timeout, all_connections_stopped_sender.clone(), ); ( diff --git a/apollo-router/src/axum_factory/listeners.rs b/apollo-router/src/axum_factory/listeners.rs index f716a7695d..40a90cf130 100644 --- a/apollo-router/src/axum_factory/listeners.rs +++ b/apollo-router/src/axum_factory/listeners.rs @@ -320,6 +320,7 @@ pub(super) fn serve_router_on_listen_addr( router: axum::Router, opt_max_headers: Option, opt_max_buf_size: Option, + opt_http_read_timeout: Duration, all_connections_stopped_sender: mpsc::Sender<()>, ) -> (impl Future, oneshot::Sender<()>) { let (shutdown_sender, shutdown_receiver) = oneshot::channel::<()>(); @@ -381,7 +382,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(Duration::from_secs(10)); + .header_read_timeout(opt_http_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } @@ -405,7 +406,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(Duration::from_secs(10)); + .header_read_timeout(opt_http_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } @@ -439,7 +440,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(Duration::from_secs(10)); + .header_read_timeout(opt_http_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } From de2127f56d1cab4d780d4d9b44449ffe68710bfb Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Mon, 14 Apr 2025 17:10:43 -0400 Subject: [PATCH 4/8] style: fix lint errors --- .../axum_factory/axum_http_server_factory.rs | 6 +-- apollo-router/src/axum_factory/listeners.rs | 8 ++-- apollo-router/src/configuration/server.rs | 40 +++++-------------- apollo-router/src/configuration/tests.rs | 10 ++++- 4 files changed, 24 insertions(+), 40 deletions(-) diff --git a/apollo-router/src/axum_factory/axum_http_server_factory.rs b/apollo-router/src/axum_factory/axum_http_server_factory.rs index bd2cccda03..fffcb35c9c 100644 --- a/apollo-router/src/axum_factory/axum_http_server_factory.rs +++ b/apollo-router/src/axum_factory/axum_http_server_factory.rs @@ -4,7 +4,7 @@ use std::pin::Pin; use std::sync::Arc; use std::sync::atomic::AtomicU64; use std::sync::atomic::Ordering; -use std::time::{Duration, Instant}; +use std::time::Instant; use axum::Router; use axum::extract::Extension; @@ -226,7 +226,7 @@ impl HttpServerFactory for AxumHttpServerFactory { all_routers.main.1, configuration.limits.http1_max_request_headers, configuration.limits.http1_max_request_buf_size, - configuration.server.http.header_read_timeout, + configuration.server.http.header_read_timeout, all_connections_stopped_sender.clone(), ); @@ -269,7 +269,7 @@ impl HttpServerFactory for AxumHttpServerFactory { router, configuration.limits.http1_max_request_headers, configuration.limits.http1_max_request_buf_size, - configuration.server.http.header_read_timeout, + configuration.server.http.header_read_timeout, all_connections_stopped_sender.clone(), ); ( diff --git a/apollo-router/src/axum_factory/listeners.rs b/apollo-router/src/axum_factory/listeners.rs index 40a90cf130..4bbdb78e88 100644 --- a/apollo-router/src/axum_factory/listeners.rs +++ b/apollo-router/src/axum_factory/listeners.rs @@ -320,7 +320,7 @@ pub(super) fn serve_router_on_listen_addr( router: axum::Router, opt_max_headers: Option, opt_max_buf_size: Option, - opt_http_read_timeout: Duration, + http_read_timeout: Duration, all_connections_stopped_sender: mpsc::Sender<()>, ) -> (impl Future, oneshot::Sender<()>) { let (shutdown_sender, shutdown_receiver) = oneshot::channel::<()>(); @@ -382,7 +382,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(opt_http_read_timeout); + .header_read_timeout(http_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } @@ -406,7 +406,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(opt_http_read_timeout); + .header_read_timeout(http_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } @@ -440,7 +440,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(opt_http_read_timeout); + .header_read_timeout(http_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } diff --git a/apollo-router/src/configuration/server.rs b/apollo-router/src/configuration/server.rs index 010e85ec01..a2ed812671 100644 --- a/apollo-router/src/configuration/server.rs +++ b/apollo-router/src/configuration/server.rs @@ -1,7 +1,9 @@ -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; use std::time::Duration; +use schemars::JsonSchema; +use serde::Deserialize; +use serde::Serialize; + const DEFAULT_HEADER_READ_TIMEOUT: Duration = Duration::from_secs(10); fn default_header_read_timeout() -> Duration { @@ -36,16 +38,6 @@ impl Default for ServerHttpConfig { } } -#[buildstructor::buildstructor] -impl ServerHttpConfig { - #[builder] - pub(crate) fn new(header_read_timeout: Option) -> Self { - Self { - header_read_timeout: header_read_timeout.unwrap_or_default(), - } - } -} - #[buildstructor::buildstructor] impl Server { #[builder] @@ -65,6 +57,7 @@ impl Default for Server { #[cfg(test)] mod tests { use serde_json::json; + use super::*; #[test] @@ -77,21 +70,6 @@ mod tests { ); } - #[test] - fn it_builds_custom_server_configuration() { - let duration_seconds = Duration::from_secs(30); - let http_config = ServerHttpConfig::builder() - .header_read_timeout(duration_seconds) - .build(); - let server_config = Server::builder() - .http(http_config) - .build(); - assert_eq!( - server_config.http.header_read_timeout, - duration_seconds - ); - } - #[test] fn it_json_parses_default_header_read_timeout_when_server_http_config_omitted() { let json_server = json!({}); @@ -115,10 +93,10 @@ mod tests { #[test] fn it_json_parses_specified_server_config_seconds_correctly() { let json_config = json!({ - "http": { - "header_read_timeout": "30s" - } - }); + "http": { + "header_read_timeout": "30s" + } + }); let config: Server = serde_json::from_value(json_config).unwrap(); diff --git a/apollo-router/src/configuration/tests.rs b/apollo-router/src/configuration/tests.rs index 53dda5e3e0..d4e26d45f2 100644 --- a/apollo-router/src/configuration/tests.rs +++ b/apollo-router/src/configuration/tests.rs @@ -1175,7 +1175,10 @@ fn it_includes_default_header_read_timeout_when_server_config_omitted() { let config: Configuration = serde_json::from_value(json_config).unwrap(); - assert_eq!(config.server.http.header_read_timeout, Duration::from_secs(10)); + assert_eq!( + config.server.http.header_read_timeout, + Duration::from_secs(10) + ); } #[test] @@ -1190,7 +1193,10 @@ fn it_processes_specified_server_config_correctly() { let config: Configuration = serde_json::from_value(json_config).unwrap(); - assert_eq!(config.server.http.header_read_timeout, Duration::from_secs(30)); + assert_eq!( + config.server.http.header_read_timeout, + Duration::from_secs(30) + ); } fn has_field_level_serde_defaults(lines: &[&str], line_number: usize) -> bool { From 1b195743f3aa750f570895f712d85bbba71df23e Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Mon, 14 Apr 2025 21:28:38 -0400 Subject: [PATCH 5/8] test: update configuration test snapshot --- ...nfiguration__tests__schema_generation.snap | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap b/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap index 4bf85aa58f..03ae868eeb 100644 --- a/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap +++ b/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap @@ -5816,6 +5816,31 @@ expression: "&schema" } ] }, + "Server": { + "additionalProperties": false, + "properties": { + "http": { + "$ref": "#/definitions/ServerHttpConfig", + "description": "#/definitions/ServerHttpConfig" + } + }, + "type": "object" + }, + "ServerHttpConfig": { + "additionalProperties": false, + "description": "Configuration for HTTP", + "properties": { + "header_read_timeout": { + "default": { + "nanos": 0, + "secs": 10 + }, + "description": "Header read timeout in human-readable format; defaults to 10s", + "type": "string" + } + }, + "type": "object" + }, "Source": { "oneOf": [ { @@ -9008,6 +9033,10 @@ expression: "&schema" "$ref": "#/definitions/Sandbox", "description": "#/definitions/Sandbox" }, + "server": { + "$ref": "#/definitions/Server", + "description": "#/definitions/Server" + }, "subscription": { "$ref": "#/definitions/SubscriptionConfig", "description": "#/definitions/SubscriptionConfig" From b9099ffad72d5568ff0b6f55d4ef66ae214a2b63 Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Thu, 17 Apr 2025 08:51:29 -0400 Subject: [PATCH 6/8] docs: add header_read_timeout to configuration docs --- docs/source/routing/configuration.mdx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/source/routing/configuration.mdx b/docs/source/routing/configuration.mdx index 03c70e2751..62f5cdf49f 100644 --- a/docs/source/routing/configuration.mdx +++ b/docs/source/routing/configuration.mdx @@ -1224,6 +1224,18 @@ traffic_shaping: timeout: 60s ``` +### Header Read Timeout + +The header read timeout is the amount of time the Router will wait to receive the complete request headers from a client before timing out. It applies both when the connection is fully idle and when a request has been started but sending the headers has not been completed. + +By default, the header read timeout is set to 10 seconds. A longer timeout can be configured using the `server.http.header_read_timeout` configuration option. + +```yaml title="router.yaml" +server: + http: + header_read_timeout: 30s +``` + ### Plugins You can customize the router's behavior with [plugins](/router/customizations/overview). Each plugin can have its own section in the configuration file with arbitrary values: @@ -1296,4 +1308,4 @@ Here, the `name` and `value` entries under `&insert_custom_header` are reused un ## Related topics -- [Checklist for configuring the router for production](/technotes/TN0008-production-readiness-checklist/#apollo-router) +- [Checklist for configuring the router for production](/technotes/TN0008-production-readiness-checklist/#apollo-router) \ No newline at end of file From 8e2289623111f8463543fbf16a58aac947792b60 Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Thu, 17 Apr 2025 09:10:53 -0400 Subject: [PATCH 7/8] chore: add changeset for header read timeout --- .changesets/config_header_read_timeout.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .changesets/config_header_read_timeout.md diff --git a/.changesets/config_header_read_timeout.md b/.changesets/config_header_read_timeout.md new file mode 100644 index 0000000000..fa006ae661 --- /dev/null +++ b/.changesets/config_header_read_timeout.md @@ -0,0 +1,13 @@ +### Add configurable server header read timeout ([PR #7262](https://github.com/apollographql/router/pull/7262)) + +This change exposes the server's header read timeout as the `server.http.header_read_timeout` configuration option. + +By default, the `server.http.header_read_timeout` is set to previously hard-coded 10 seconds. A longer timeout can be configured using the `server.http.header_read_timeout` option. + +```yaml title="router.yaml" +server: + http: + header_read_timeout: 30s +``` + +By [@gwardwell ](https://github.com/gwardwell) in https://github.com/apollographql/router/pull/7262 From f0aa17d841b643f040c055f85fec4d6a53e6570d Mon Sep 17 00:00:00 2001 From: Greg Wardwell Date: Thu, 17 Apr 2025 09:19:10 -0400 Subject: [PATCH 8/8] refactor: fix header_read_timeout variable name --- apollo-router/src/axum_factory/listeners.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apollo-router/src/axum_factory/listeners.rs b/apollo-router/src/axum_factory/listeners.rs index 4bbdb78e88..e77ac0d20c 100644 --- a/apollo-router/src/axum_factory/listeners.rs +++ b/apollo-router/src/axum_factory/listeners.rs @@ -320,7 +320,7 @@ pub(super) fn serve_router_on_listen_addr( router: axum::Router, opt_max_headers: Option, opt_max_buf_size: Option, - http_read_timeout: Duration, + header_read_timeout: Duration, all_connections_stopped_sender: mpsc::Sender<()>, ) -> (impl Future, oneshot::Sender<()>) { let (shutdown_sender, shutdown_receiver) = oneshot::channel::<()>(); @@ -382,7 +382,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(http_read_timeout); + .header_read_timeout(header_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } @@ -406,7 +406,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(http_read_timeout); + .header_read_timeout(header_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); } @@ -440,7 +440,7 @@ pub(super) fn serve_router_on_listen_addr( let http_config = http_connection .keep_alive(true) .timer(TokioTimer::new()) - .header_read_timeout(http_read_timeout); + .header_read_timeout(header_read_timeout); if let Some(max_headers) = opt_max_headers { http_config.max_headers(max_headers); }