Expose configurable HTTP/1 request-header parser admission limits
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend-api-design, networking
Línea de trabajo
Comienza con pingora-core/src/protocols/http/v1/common.rs y server.rs, y luego inspecciona HttpServerOptions y default_h2_options() para conocer los patrones de configuración existentes. Rastrea el análisis de solicitudes normales y de solicitudes con prefijo pipelined antes de decidir dónde deben ubicarse los límites admitidos de bytes y cantidad de campos. Se considera terminado cuando los límites no establecidos conservan el comportamiento actual, los límites configurados rechazan las solicitudes demasiado grandes antes de las callbacks de la aplicación y la semántica de HTTP/2 permanece separada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What is the problem your feature solves, or the need it fulfills?
At current main (09696b51bc59315353d96686355861604d0bb48c), downstream HTTP/1 request-header admission is fixed inside pingora-core:
pingora-core/src/protocols/http/v1/common.rsdefinesMAX_HEADERS = 256,INIT_HEADER_BUF_SIZE = 4096, andMAX_HEADER_SIZE = 1_048_575.HttpSession::read_request()inpingora-core/src/protocols/http/v1/server.rsgrows its parser buffer against that fixed ceiling. The source notes that the size check happens before the next read, so a completed large socket read can already exceed the nominal threshold before rejection.HttpServerOptionscurrently exposes transport options such as h2c, keepalive request limits, and H2 idle timeout, but no HTTP/1 request-header byte/count admission setting.
For an edge proxy that needs an operator-controlled header budget materially below the built-in ceiling, rejecting in a ProxyHttp::request_filter() callback is too late to serve as a parser/resource admission control: the request header has already been buffered and parsed before that callback.
HTTP/2 already has a different control surface: default_h2_options() applies a decoded header-list limit and H2Options::max_header_list_size can customize it. I am not proposing that HTTP/1 wire/parser bytes and HTTP/2 decoded header-list size be treated as identical accounting.
Describe the solution you'd like
Please expose a supported HTTP/1 server/composition option that can lower request-header resource admission before or during parser buffering, without requiring downstream users to copy or patch Pingora parser source.
A useful API would preserve today's behavior when unset and allow an adopter to configure, at minimum:
- a positive maximum HTTP/1 request-header byte budget; and
- preferably a positive maximum HTTP/1 header-field count, bounded by the existing safe supplier maximum.
The limit should be applied by the HTTP/1 parser path itself, including pipelined-prefix handling, rather than only after RequestHeader construction. Oversized traffic may fail at the transport/parser boundary; a specific application status such as 431 is less important than enforcing the resource bound before application callbacks.
Expected compatibility/acceptance properties:
None/unset preserves the current constants and behavior.- Near-limit HTTP/1 requests succeed; over-limit one-large-field and many-small-fields requests fail before application callback processing.
- The configured byte/count limits also apply when the request begins from a pipelined prefix on a reused connection.
- Zero/impossible values fail configuration rather than silently disabling admission.
- HTTP/2 keeps its separate decoded-header-list semantics and defaults; this proposal should not reinterpret the H2 limit as HTTP/1 wire bytes.
- The implementation remains cancellation-safe and does not require allocating up to the current ~1 MiB ceiling when an adopter configures a substantially smaller budget.
If maintainers prefer these fields on a type other than HttpServerOptions, a per-connection/session option applied before HttpSession::read_request() would also satisfy the need as long as it is a supported public API.
Describe alternatives you've considered
- Reject in
ProxyHttp::request_filter(): useful for semantic policy, but too late for parser/allocation admission becausesession.req_header()already exists. - Place Nginx/another proxy in front: defeats the purpose for deployments where Pingora is the edge authority and does not make Pingora's own parser budget configurable.
- Fork/vendor
pingora-coreto changeMAX_HEADER_SIZE/MAX_HEADERS: enforces the right phase but creates a mutable supplier fork and makes upgrades/provenance harder. - Reuse HTTP/2
max_header_list_size: not appropriate because HTTP/1 parser/wire accounting and H2 decoded header-list accounting are different contracts.
Additional context
This request is based on source inspection of current protected main at 09696b51bc59315353d96686355861604d0bb48c. A downstream integration issue tracking the same boundary is ContextualWisdomLab/pingora-gateway#43.
The goal is a supported resource-admission hook, not a product-specific header policy.
- Lenguaje dominante
- Rust
- Estrellas
- 27.7k
- Forks
- 1.8k
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 3
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudflare/pingora
-
HeaderSerde round-trip drops HTTP version and custom reason phrasePosiblemente ocupada @hakarrr la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
cloudflare/pingora#1064 ·
Los mantenedores suelen responder en 2 días
-
range_header_filter ignores Range when the range count equals max_multipart_rangesPosiblemente ocupada @hakarrr la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
cloudflare/pingora#1063 ·
Los mantenedores suelen responder en 2 días
-
HTTP/1 body writer does not treat 205 Reset Content as bodylessPosiblemente ocupada @harshbhx la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cloudflare/pingora#1055 ·
Los mantenedores suelen responder en 2 días
-
msrv: MSRV is now 1.88.0Posiblemente ocupada @Devel08 la tomó hace 15 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
cloudflare/pingora#1053 ·
Los mantenedores suelen responder en 2 días
-
pingora-limits: Estimator::incr panics on overflow with overflow checks enabledQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
cloudflare/pingora#1040 ·
Los mantenedores suelen responder en 2 días
Todos los issues de cloudflare/pingora
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
libnativeapi/nativeapi#21 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
longbridge/nsh#804 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día