-
Notifications
You must be signed in to change notification settings - Fork 321
Add HTTP header size and limit configuration to server.http section #8269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
@smyrick 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
@Copilot: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 1 changed, 0 removed
Build ID: da4aa5aa1da3a67c1c6f4f71 URL: https://www.apollographql.com/docs/deploy-preview/da4aa5aa1da3a67c1c6f4f71 |
Co-authored-by: smyrick <[email protected]>
Co-authored-by: smyrick <[email protected]>
Co-authored-by: smyrick <[email protected]>
@Copilot, please consider creating a changeset entry in |
Co-authored-by: smyrick <[email protected]>
Co-authored-by: smyrick <[email protected]>
Co-authored-by: smyrick <[email protected]>
Co-authored-by: smyrick <[email protected]>
…ation Co-authored-by: smyrick <[email protected]>
Co-authored-by: smyrick <[email protected]>
Co-authored-by: smyrick <[email protected]>
…nd remove middleware-level limits (#8286)
This PR implements comprehensive HTTP header configuration for Apollo Router, addressing the need for configurable header limits similar to Node.js's
--max-http-header-size
option.Changes
New Configuration Options
Added new HTTP header configuration fields to the
server.http
section:Protocol-Aware Implementation
The implementation provides proper protocol-specific handling:
max_headers
for header count limits and integrates with existing buffer-based limitsmax_header_size
for individual header limits andmax_header_list_size
for total header payload limitsBackward Compatibility
Maintains full backward compatibility with existing
limits
configuration:Implementation Details
ServerHttpConfig
with proper serde attributes and JSON schema supportserve_router_on_listen_addr
to apply configuration to both HTTP/1.1 and HTTP/2 connectionsget_effective_http_config
helper for backward compatibilityTesting and Documentation
Benefits
max_header_size
works similarly to Node.js--max-http-header-size
This allows users to configure header limits beyond the default 16kb Hyper limit mentioned in the issue, providing both YAML configuration and fine-grained control over HTTP header processing.
Fixes #5277.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.