Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

431 and 414 responses sent by hyper or h2 never reach the Service, so metrics middleware can't record them

Abierto
#4,249 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start by reading the hyper and h2 rejection paths named in the issue: proto/h1/role.rs and proto/streams/streams.rs. Trace how each path produces a 431 or 414 and consider where the server could expose the status to applications. Done means an application can observe these responses, including their status codes, for both HTTP/1.1 and HTTP/2.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

C-feature

Is your feature request related to a problem? Please describe.

When a request is too large for the server's limits, hyper (HTTP/1.1) or h2 (HTTP/2) writes the error response itself, and the request never reaches the Service. Middleware that records each request never sees these responses, for e.g. an OpenTelemetry histogram or a tracing span.

Here's what is observable today (hyper 1.12.0, h2 0.4.20):

Protocol Rejection Who responds What the application gets
HTTP/1.1 More than max_headers headers, or a head larger than max_buf_size hyper, 431 (Server::on_error in proto/h1/role.rs) The connection future returns Err, and is_parse_too_large() is true
HTTP/1.1 URI longer than 65,534 bytes hyper, 414 The same: is_parse_too_large() is true. Only the Display text, "URI too long", distinguishes it from the 431
HTTP/2 Header list larger than max_header_list_size h2, 431 followed by RST_STREAM (Streams::recv_headers in proto/streams/streams.rs) Nothing. The connection keeps serving other streams and ends with Ok(())

For HTTP/1.1 we can approximate a metric from the connection error. To tell a 414 from a 431, though, we have to match on the error's Display string, and we have none of the request's attributes, such as its method. For HTTP/2 there is nothing to hook into: no error, event or callback reaches hyper or the application when h2 answers with a 431.

Describe the solution you'd like

Some way for a server application to learn that hyper or h2 answered a request on its own, and with which status code - not entirely sure what this should look like yet.

Describe alternatives you've considered

Not aware of any other ways to solve this yet

Lenguaje dominante
Rust
Estrellas
16.4k
Forks
1.8k
Merge medio
1 d 13 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de hyperium/hyper

Todos los issues de hyperium/hyper

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.