Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changesets/fix_http2_header_size_config_name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Fix HTTP/2 header size limit config option name ([PR #8730](https://github.com/apollographql/router/pull/8730))

The configuration option for HTTP/2 header size limits has been renamed from `http2_max_headers_list_bytes` to `http2_max_headers_list_size` for consistency with naming conventions.


By [@aaronArinder](https://github.com/aaronArinder) in https://github.com/apollographql/router/pull/8730
2 changes: 1 addition & 1 deletion apollo-router/src/axum_factory/listeners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub(super) fn serve_router_on_listen_addr(
) -> (impl Future<Output = Listener>, oneshot::Sender<()>) {
let opt_max_http1_headers = configuration.limits.http1_max_request_headers;
let opt_max_http1_buf_size = configuration.limits.http1_max_request_buf_size;
let opt_max_http2_headers_list_bytes = configuration.limits.http2_max_headers_list_bytes;
let opt_max_http2_headers_list_bytes = configuration.limits.http2_max_headers_list_size;
let connection_shutdown_timeout = configuration.supergraph.connection_shutdown_timeout;
let header_read_timeout = configuration.server.http.header_read_timeout;

Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/plugins/limits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub(crate) struct Config {
/// If router receives more headers than allowed size of the header list, it responds to the client with
/// "431 Request Header Fields Too Large".
#[schemars(with = "Option<String>", default)]
pub(crate) http2_max_headers_list_bytes: Option<ByteSize>,
pub(crate) http2_max_headers_list_size: Option<ByteSize>,

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

// This is `apollo-parser`’s default, which protects against stack overflow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ supergraph:
limits:
http1_max_request_headers: 100
http1_max_request_buf_size: "16000"
http2_max_headers_list_bytes: "20Mib"
http2_max_headers_list_size: "20Mib"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ supergraph:
limits:
http1_max_request_headers: 100
http1_max_request_buf_size: "16000"
http2_max_headers_list_bytes: "20Mib"
http2_max_headers_list_size: "20Mib"

tls:
supergraph:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ supergraph:
limits:
http1_max_request_headers: 100
http1_max_request_buf_size: "16000"
http2_max_headers_list_bytes: "20Mib"
http2_max_headers_list_size: "20Mib"
1 change: 1 addition & 0 deletions docs/shared/config/limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
limits:
http1_max_request_buf_size: null
http1_max_request_headers: null
http2_max_headers_list_size: null
http_max_request_bytes: 2000000
introspection_max_depth: true
max_aliases: null
Expand Down
1 change: 1 addition & 0 deletions docs/shared/router-config-properties-table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ Configuration for operation limits, parser limits, HTTP limits, etc.
limits:
http1_max_request_buf_size: null
http1_max_request_headers: null
http2_max_headers_list_size: null
http_max_request_bytes: 2000000
introspection_max_depth: true
max_aliases: null
Expand Down
1 change: 1 addition & 0 deletions docs/shared/router-yaml-complete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ license_enforcement: {}
limits:
http1_max_request_buf_size: null
http1_max_request_headers: null
http2_max_headers_list_size: null
http_max_request_bytes: 2000000
introspection_max_depth: true
max_aliases: null
Expand Down
7 changes: 7 additions & 0 deletions docs/source/routing/security/request-limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
http_max_request_bytes: 2000000 # Default value: 2 MB
http1_max_request_headers: 200 # Default value: 100
http1_max_request_buf_size: 800kb # Default value: 400kib
http2_max_headers_list_size: 32kb # Default value: 16kb, but is subject to change

# Parser-based limits
parser_max_tokens: 15000 # Default value
Expand Down Expand Up @@ -291,6 +292,12 @@

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

### `http2_max_headers_list_size`

Limit the maximum size of the HTTP/2 header list. Default is 16KiB, but is subject to change.

Check warning on line 297 in docs/source/routing/security/request-limits.mdx

View check run for this annotation

Apollo Librarian / AI Style Review

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

Corrects the sentence fragment "Default is..." to "The default value is...". Uses code font for the value `16kb` and matches the unit used in the code example for consistency. ```suggestion Limit the maximum size of the HTTP/2 header list. The default value is `16kb` (subject to change). ```

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`.

## Parser-based limits

### `parser_max_tokens`
Expand Down