Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#4,249 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Rust
Stelle
16.4k
Fork
1.8k
Merge medio
1g 13h
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hyperium/hyper

Tutte le issue di hyperium/hyper

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.