Skip to content

Commit d130fb3

Browse files
committed
fix(naming, docs): change http/2 config option name
1 parent 080acd9 commit d130fb3

File tree

9 files changed

+16
-6
lines changed

9 files changed

+16
-6
lines changed

apollo-router/src/axum_factory/listeners.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ pub(super) fn serve_router_on_listen_addr(
317317
) -> (impl Future<Output = Listener>, oneshot::Sender<()>) {
318318
let opt_max_http1_headers = configuration.limits.http1_max_request_headers;
319319
let opt_max_http1_buf_size = configuration.limits.http1_max_request_buf_size;
320-
let opt_max_http2_headers_list_bytes = configuration.limits.http2_max_headers_list_bytes;
320+
let opt_max_http2_headers_list_bytes = configuration.limits.http2_max_headers_list_size;
321321
let connection_shutdown_timeout = configuration.supergraph.connection_shutdown_timeout;
322322
let header_read_timeout = configuration.server.http.header_read_timeout;
323323

apollo-router/src/plugins/limits/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub(crate) struct Config {
120120
/// If router receives more headers than allowed size of the header list, it responds to the client with
121121
/// "431 Request Header Fields Too Large".
122122
#[schemars(with = "Option<String>", default)]
123-
pub(crate) http2_max_headers_list_bytes: Option<ByteSize>,
123+
pub(crate) http2_max_headers_list_size: Option<ByteSize>,
124124

125125
/// Limit the depth of nested list fields in introspection queries
126126
/// to protect avoid generating huge responses. Returns a GraphQL
@@ -142,7 +142,7 @@ impl Default for Config {
142142
http_max_request_bytes: 2_000_000,
143143
http1_max_request_headers: None,
144144
http1_max_request_buf_size: None,
145-
http2_max_headers_list_bytes: None,
145+
http2_max_headers_list_size: None,
146146
parser_max_tokens: 15_000,
147147

148148
// This is `apollo-parser`’s default, which protects against stack overflow

apollo-router/tests/integration/fixtures/tcp.header_limited.router.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ supergraph:
44
limits:
55
http1_max_request_headers: 100
66
http1_max_request_buf_size: "16000"
7-
http2_max_headers_list_bytes: "20Mib"
7+
http2_max_headers_list_size: "20Mib"

apollo-router/tests/integration/fixtures/tls.header_limited.router.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ supergraph:
44
limits:
55
http1_max_request_headers: 100
66
http1_max_request_buf_size: "16000"
7-
http2_max_headers_list_bytes: "20Mib"
7+
http2_max_headers_list_size: "20Mib"
88

99
tls:
1010
supergraph:

apollo-router/tests/integration/fixtures/unix.header_limited.router.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ supergraph:
44
limits:
55
http1_max_request_headers: 100
66
http1_max_request_buf_size: "16000"
7-
http2_max_headers_list_bytes: "20Mib"
7+
http2_max_headers_list_size: "20Mib"

docs/shared/config/limits.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
limits:
55
http1_max_request_buf_size: null
66
http1_max_request_headers: null
7+
http2_max_headers_list_size: null
78
http_max_request_bytes: 2000000
89
introspection_max_depth: true
910
max_aliases: null

docs/shared/router-config-properties-table.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ Configuration for operation limits, parser limits, HTTP limits, etc.
449449
limits:
450450
http1_max_request_buf_size: null
451451
http1_max_request_headers: null
452+
http2_max_headers_list_size: null
452453
http_max_request_bytes: 2000000
453454
introspection_max_depth: true
454455
max_aliases: null

docs/shared/router-yaml-complete.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ license_enforcement: {}
230230
limits:
231231
http1_max_request_buf_size: null
232232
http1_max_request_headers: null
233+
http2_max_headers_list_size: null
233234
http_max_request_bytes: 2000000
234235
introspection_max_depth: true
235236
max_aliases: null

docs/source/routing/security/request-limits.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limits:
1717
http_max_request_bytes: 2000000 # Default value: 2 MB
1818
http1_max_request_headers: 200 # Default value: 100
1919
http1_max_request_buf_size: 800kb # Default value: 400kib
20+
http2_max_headers_list_size: 32kb # Default value: 16kb, but is subject to change
2021

2122
# Parser-based limits
2223
parser_max_tokens: 15000 # Default value
@@ -291,6 +292,12 @@ If router receives more headers than the buffer size, it responds to the client
291292

292293
Limit the maximum buffer size for the HTTP1 connection. Default is ~400kib.
293294

295+
### `http2_max_headers_list_size`
296+
297+
Limit the maximum size of the HTTP/2 header list. Default is 16KiB, but is subject to change.
298+
299+
If the router receives a request with HTTP/2 headers whose total size exceeds the configured limit, it responds to the client with `431 Request Header Fields Too Large`.
300+
294301
## Parser-based limits
295302

296303
### `parser_max_tokens`

0 commit comments

Comments
 (0)